[qet] qet/qet: [4974] minor update

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4974
Author:   rdsivd
Date:     2017-05-29 23:23:10 +0200 (Mon, 29 May 2017)
Log Message:
-----------
minor update

Modified Paths:
--------------
    branches/DXFtoQET3_DB/db/dbmanager.cpp
    branches/DXFtoQET3_DB/db/dbmanager.h
    branches/DXFtoQET3_DB/dxftoqet3db.cpp
    branches/DXFtoQET3_DB/dxftoqet3db.h
    branches/DXFtoQET3_DB/dxftoqet3db.ui

Modified: branches/DXFtoQET3_DB/db/dbmanager.cpp
===================================================================
--- branches/DXFtoQET3_DB/db/dbmanager.cpp	2017-05-27 15:24:55 UTC (rev 4973)
+++ branches/DXFtoQET3_DB/db/dbmanager.cpp	2017-05-29 21:23:10 UTC (rev 4974)
@@ -1,4 +1,5 @@
 #include "dbmanager.h"
+//#include "ui_dxftoqet3db.h"
 
 extern struct DXF_codes DXF_code_tables[DXF_codes_set];
 extern struct DXF_base DXF_main_base[DXF_base_set];
@@ -5,7 +6,14 @@
 
 dbManager::dbManager(QWidget *parent) : QWidget(parent)
 {
+	connect (this ,SIGNAL (send_log(const QString &)),this,SLOT(update_log(const QString &)));
+	connect (this, SIGNAL (send_elmt(const QString &)),this,SLOT(update_elmt(const QString &)));
+	connect (this, SIGNAL (send_process(const QString &)),this,SLOT(update_proces(const QString &)));
 
+	connect (this,SIGNAL(send_text(const QString &)),this,SLOT(on_progressBar_text(const QString &)));
+	connect (this,SIGNAL(send_min(const int &)),this,SLOT(on_progressBar_valueMin(const int &)));
+	connect (this,SIGNAL(send_max(const int &)),this,SLOT(on_progressBar_valueMax(const int &)));
+	connect (this,SIGNAL(send_actual(const int &)),this,SLOT(on_progressBar_valueChanged(const int &)));
 }
 
 void dbManager::dbManager1(const QString &pathname)
@@ -1200,9 +1208,19 @@
 
 int dbManager::DB_dbManager_added_records(const QString &pathname, int32_t *Max_lines, int32_t *Record_count, QString dxf_type)
 {
+	connect (this ,SIGNAL (send_log(const QString &)),this,SLOT(update_log(const QString &)));
+
 	m_db.transaction();
 	QSqlQuery Query1;
 
+	Signal_log1.clear();
+	Signal_log1.append(" DB add records : ");
+	Signal_log1.append("\n");
+	Signal_log1.append("============================================================================");
+	//Signal_log1.append("\n");
+
+	emit send_log(Signal_log1);
+
 	x1=0;
 	//x10=0;
 
@@ -1333,6 +1351,20 @@
 	Record_count_lines=*Record_count;
 	x1=0;
 
+	Signal_log1.clear();
+	Signal_log1.append(" index : ");
+	Signal_log1.append(QString::number(Record_count_lines));
+	Signal_log1.append(DXF_code_tables[0].Section);
+	Signal_log1.append(DXF_code_tables[0].Command);
+
+
+	//Signal_log1.append(" DB add records : ");
+	//Signal_log1.append("\n");
+	//Signal_log1.append("============================================================================");
+	Signal_log1.append("\n");
+
+	emit send_log(Signal_log1);
+
 	while ((x1<Max_count_lines) and (x1<DXF_codes_set))
 	{
 		//DXF_code_tables[x1].ID_instruction=1;
@@ -1352,6 +1384,8 @@
 
 		//Record_count_lines++;
 
+
+
 			//RecordNr=(QString::number(Record_count_lines));
 			//Query1.bindValue(":Index_count",RecordNr);
 			Query1.bindValue(":Index_count",Record_count_lines);
@@ -2658,6 +2692,8 @@
 
 void dbManager::dbManager_transfer_dxf(const QString &pathname)
 {
+	connect (this ,SIGNAL (send_log(const QString &)),parent(),SLOT(update_log(const QString &)));
+
 	m_db.transaction();
 
 	//QsqlString="create table dxf_file (Index_count primary key, Code, Waarde, Section, Commando )";
@@ -2735,6 +2771,26 @@
 		Write_transfer.bindValue(":Commando",Transfer_Commando);
 		Write_transfer.bindValue(":AcadValue",Transfer_AcadValue);
 
+		Signal_log1.clear();
+		Signal_log1.append(" index count : ");
+		Signal_log1.append(QString::number(transfer_count));
+		Signal_log1.append(" dxf code : ");
+		Signal_log1.append(List_1);
+		Signal_log1.append(" Value : ");
+		Signal_log1.append(List_2);
+		Signal_log1.append(" Section : ");
+		Signal_log1.append(Transfer_Section);
+		Signal_log1.append(" Commando : ");
+		Signal_log1.append(Transfer_Commando);
+		Signal_log1.append(" AcadValue : ");
+		Signal_log1.append(QString::number(Transfer_AcadValue));
+
+
+
+		Signal_log1.append("\n");
+
+		emit send_log(Signal_log1);
+
 		Write_transfer.exec();
 
 		transfer_count++;

Modified: branches/DXFtoQET3_DB/db/dbmanager.h
===================================================================
--- branches/DXFtoQET3_DB/db/dbmanager.h	2017-05-27 15:24:55 UTC (rev 4973)
+++ branches/DXFtoQET3_DB/db/dbmanager.h	2017-05-29 21:23:10 UTC (rev 4974)
@@ -74,6 +74,8 @@
 	QString BlockNaamID;
 
 
+	QString Signal_log1;
+	QString Signal_elmt1;
 
 	QString RecordNr;
 
@@ -107,7 +109,15 @@
 	signals:
 
 
+	void send_text (const QString &text2);
+	void send_min(const int &valuemin);
+	void send_max(const int &valuemax);
+	void send_actual(const int &valueactual);
 
+	void send_log(const QString &Waarde2);
+	void send_elmt(const QString &Waarde3);
+	void send_process(const QString &Waarde4);
+
 	public slots:
 
 	private:

Modified: branches/DXFtoQET3_DB/dxftoqet3db.cpp
===================================================================
--- branches/DXFtoQET3_DB/dxftoqet3db.cpp	2017-05-27 15:24:55 UTC (rev 4973)
+++ branches/DXFtoQET3_DB/dxftoqet3db.cpp	2017-05-29 21:23:10 UTC (rev 4974)
@@ -1264,6 +1264,11 @@
 	ui->dxf_section_count->clear();
 	ui->dxf_section_count->insert(text1);
 
+	Signal_log1.clear();
+	Signal_log1.append(QTime::currentTime().toString());
+	//Signal_log1.append("\n");
+	Signal_log1.append("filling table dxf_header ");
+	emit send_log(Signal_log1);
 
 	while (count_header< header_max_items)
 	{
@@ -1310,7 +1315,7 @@
 		/*Signal_log1.clear();
 		Signal_log1.append(QTime::currentTime().toString());
 		Signal_log1.append("\n");
-		Signal_log1.append("end split ");
+		Signal_log1.append("table dxf_header : ");
 		emit send_log(Signal_log1);*/
 
 		Record_Count_Header= mydb.DB_dbManager_added_records(Filename_db, &max,&Record_Count_Header,"dxf_header");
@@ -1359,7 +1364,23 @@
 		}
 	}
 
+	Signal_log1.clear();
+	Signal_log1.append("============================================================================");
+	Signal_log1.append("\n");
+	Signal_log1.append(QTime::currentTime().toString());
+	Signal_log1.append(" - splitter : ");
+	Signal_log1.append(QString::number(x3max));
+	Signal_log1.append(" - list items : ");
+	Signal_log1.append(QString::number(count_list_item));
+	Signal_log1.append(" - table list : ");
+	Signal_log1.append(QString::number(count_tables_list));
+	Signal_log1.append(" - header id : ");
+	Signal_log1.append(QString::number(header_id));
+	Signal_log1.append("\n");
 
+	emit send_log(Signal_log1);
+
+
 	while (count_list_item<(x3max-1) and count_list_item<DXF_codeset_copies)
 	{
 
@@ -1366,7 +1387,17 @@
 		line1=QString(split_tables_list[count_tables_list][count_list_item]).toInt();
 		line2=split_tables_list[count_tables_list][count_list_item+1];
 
+		Signal_log1.clear();
+		Signal_log1.append(" count item ");
+		Signal_log1.append(QString::number(count_list_item));
+		Signal_log1.append(" - item code : ");
+		Signal_log1.append(QString::number(line1));
+		Signal_log1.append(" - value : ");
+		Signal_log1.append(line2);
+		//Signal_log1.append("\n");
 
+		emit send_log(Signal_log1);
+
 		DXF_main_base[0].split_list_1[line1].append(line2);
 
 
@@ -1590,7 +1621,7 @@
 	Signal_log1.clear();
 	Signal_log1.append(QTime::currentTime().toString());
 	Signal_log1.append("\n");
-	Signal_log1.append("tables items : ");
+	Signal_log1.append("classes items : ");
 	Signal_log1.append(QString::number(classes_max_items));
 	//Signal_log1.append("============================================================================");
 
@@ -2276,11 +2307,11 @@
 	blocks_max_count=dxf_blocks.count();
 
 	Signal_log1.clear();
+	Signal_log1.append("============================================================================");
+	Signal_log1.append("\n");
 	Signal_log1.append(QTime::currentTime().toString());
-	Signal_log1.append("\n");
-	Signal_log1.append("tables items : ");
+	Signal_log1.append(" - blocks items : ");
 	Signal_log1.append(QString::number(blocks_max_items));
-	//Signal_log1.append("============================================================================");
 
 	emit send_log(Signal_log1);
 
@@ -2294,6 +2325,9 @@
 	//clear_dxf_tables_items();
 	clear_split_tables();
 
+	emit send_min(0);
+	emit send_max(tables_max_items);
+
 	x1=-1;
 
 	while ((Tables_Query.next()) and (x1<DXF_item_split))
@@ -2300,6 +2334,8 @@
 	{
 		QSqlRecord Header_record=Tables_Query.record();
 
+		//emit send_actual(x1);
+
 		Read_Index=Header_record.value("Index_count").toString();
 		Read_Code=Header_record.value("Code").toString();
 		Read_Waarde=Header_record.value("Waarde").toString();
@@ -2310,6 +2346,7 @@
 		if ((Header_record.value("Code").toInt()==0) and (x1<DXF_item_split))
 		{
 			x1++;
+			emit send_actual(x1);
 			split_tables_list[x1].append(Header_record.value("Code").toString() );
 
 			split_tables_list[x1].append(Header_record.value("Waarde").toString() );
@@ -2325,12 +2362,10 @@
 
 	Signal_log1.clear();
 	Signal_log1.append(QTime::currentTime().toString());
+	Signal_log1.append(" - end split table ");
+	Signal_log1.append(QString::number(x1));
 	Signal_log1.append("\n");
-	Signal_log1.append("end split table ");
 
-	//Signal_log1.append(QString::number(tables_max_items));
-	//Signal_log1.append("============================================================================");
-
 	emit send_log(Signal_log1);
 
 	/*for (x2=0;x2<tables_max_count and tables_max_items<DXF_item_split;x2++)
@@ -2356,10 +2391,9 @@
 	Signal_log1.clear();
 	Signal_log1.append("Splitting tables ");
 	Signal_log1.append(QString::number(blocks_max_items));
+	Signal_log1.append(" - X1 : ");
+	Signal_log1.append(QString::number(x1));
 	Signal_log1.append("\n");
-	Signal_log1.append("X1 : ");
-	Signal_log1.append(QString::number(x1));
-	//Signal_log1.append("============================================================================");
 
 	emit send_log(Signal_log1);
 
@@ -2603,7 +2637,7 @@
 	Signal_log1.clear();
 	Signal_log1.append(QTime::currentTime().toString());
 	Signal_log1.append("\n");
-	Signal_log1.append("tables items : ");
+	Signal_log1.append("entities items : ");
 	Signal_log1.append(QString::number(entities_max_items));
 	//Signal_log1.append("============================================================================");
 
@@ -6625,6 +6659,8 @@
 
 	emit send_log(Signal_log1);
 
+	connect (&mydb ,SIGNAL (send_log(const QString &)),this,SLOT(update_log(const QString &)));
+
 	mydb.dbManager_create_tables(FileName);
 
 	dxf_split_count1=DXF_main_base[0].dxf_input.count();

Modified: branches/DXFtoQET3_DB/dxftoqet3db.h
===================================================================
--- branches/DXFtoQET3_DB/dxftoqet3db.h	2017-05-27 15:24:55 UTC (rev 4973)
+++ branches/DXFtoQET3_DB/dxftoqet3db.h	2017-05-29 21:23:10 UTC (rev 4974)
@@ -48,6 +48,7 @@
 	~DXFtoQET3DB();
 
 		dbManager mydb;
+		//connect (&mydb ,SIGNAL (send_log(const QString &)),parent(),SLOT(update_log(const QString &)));
 
 		QString QSQL_split;
 

Modified: branches/DXFtoQET3_DB/dxftoqet3db.ui
===================================================================
--- branches/DXFtoQET3_DB/dxftoqet3db.ui	2017-05-27 15:24:55 UTC (rev 4973)
+++ branches/DXFtoQET3_DB/dxftoqet3db.ui	2017-05-29 21:23:10 UTC (rev 4974)
@@ -574,26 +574,6 @@
       </property>
      </spacer>
     </item>
-    <item row="0" column="2">
-     <widget class="QPushButton" name="OpenFile">
-      <property name="text">
-       <string>Open dxf file</string>
-      </property>
-     </widget>
-    </item>
-    <item row="0" column="1">
-     <widget class="QPushButton" name="Load_dxf_into_tables">
-      <property name="enabled">
-       <bool>true</bool>
-      </property>
-      <property name="text">
-       <string>Load dxf into proces</string>
-      </property>
-      <property name="flat">
-       <bool>false</bool>
-      </property>
-     </widget>
-    </item>
     <item row="0" column="0">
      <widget class="QPushButton" name="Delete_DB">
       <property name="text">
@@ -627,6 +607,26 @@
       </property>
      </widget>
     </item>
+    <item row="0" column="1">
+     <widget class="QPushButton" name="OpenFile">
+      <property name="text">
+       <string>Open dxf file</string>
+      </property>
+     </widget>
+    </item>
+    <item row="0" column="2">
+     <widget class="QPushButton" name="Load_dxf_into_tables">
+      <property name="enabled">
+       <bool>true</bool>
+      </property>
+      <property name="text">
+       <string>Load dxf into proces</string>
+      </property>
+      <property name="flat">
+       <bool>false</bool>
+      </property>
+     </widget>
+    </item>
    </layout>
   </widget>
   <widget class="QWidget" name="layoutWidget">


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/