[qet] qet/qet: [4931] Corrected the load into db, conversion more accurate now

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


Revision: 4931
Author:   rdsivd
Date:     2017-03-16 23:39:06 +0100 (Thu, 16 Mar 2017)
Log Message:
-----------
Corrected the load into db, conversion more accurate now

Modified Paths:
--------------
    branches/DXFtoQET3_DB/Convertion prestations.ods
    branches/DXFtoQET3_DB/dxftoqet3db.cpp
    branches/DXFtoQET3_DB/dxftoqet3db.h
    branches/DXFtoQET3_DB/src/ELMT_steps/elmt_block_level2.cpp
    branches/DXFtoQET3_DB/src/ELMT_steps/elmt_blocks.cpp

Modified: branches/DXFtoQET3_DB/Convertion prestations.ods
===================================================================
(Binary files differ)

Modified: branches/DXFtoQET3_DB/dxftoqet3db.cpp
===================================================================
--- branches/DXFtoQET3_DB/dxftoqet3db.cpp	2017-03-14 16:40:41 UTC (rev 4930)
+++ branches/DXFtoQET3_DB/dxftoqet3db.cpp	2017-03-16 22:39:06 UTC (rev 4931)
@@ -954,15 +954,11 @@
 void DXFtoQET3DB::split_header()
 {
 	header_max_items=dxf_header.count("  9");
-	if (header_max_items==0)
-	{
-		header_max_items=dxf_header.count(" 9");
-	}
-	if (header_max_items==0)
-	{
-		header_max_items=dxf_header.count("9");
-	}
+	header_max_items2=dxf_header.count(" 9");
+	header_max_items3=dxf_header.count("9");
 
+	header_max_items=header_max_items+header_max_items2+header_max_items3;
+
 	header_max_count=dxf_header.count();
 
 	Signal_log1.clear();
@@ -1091,15 +1087,11 @@
 void DXFtoQET3DB::split_classes()
 {
 	classes_max_items=dxf_classes.count("  0");
-	if (classes_max_items==0)
-	{
-		classes_max_items=dxf_classes.count(" 0");
-	}
-	if (classes_max_items==0)
-	{
-		classes_max_items=dxf_classes.count("0");
-	}
+	classes_max_items2=dxf_classes.count(" 0");
+	classes_max_items3=dxf_classes.count("0");
 
+	classes_max_items=classes_max_items+classes_max_items2+classes_max_items3;
+
 	classes_max_count=dxf_classes.count();
 
 	Signal_log1.clear();
@@ -1357,14 +1349,11 @@
 void DXFtoQET3DB::split_blocks()
 {
 	blocks_max_items=dxf_blocks.count("  0");
-	if (blocks_max_items==0)
-	{
-		blocks_max_items=dxf_blocks.count(" 0");
-	}
-	{
-		blocks_max_items=dxf_blocks.count("0");
-	}
+	blocks_max_items2=dxf_blocks.count(" 0");
+	blocks_max_items3=dxf_blocks.count("0");
 
+	blocks_max_items=blocks_max_items+blocks_max_items2+blocks_max_items3;
+
 	blocks_max_count=dxf_blocks.count();
 
 	Signal_log1.clear();
@@ -1480,15 +1469,11 @@
 void DXFtoQET3DB::split_entities()
 {
 	entities_max_items=dxf_entities.count("  0");
-	if (entities_max_items==0)
-	{
-		entities_max_items=dxf_entities.count(" 0");
-	}
-	if (entities_max_items==0)
-	{
-		entities_max_items=dxf_entities.count("0");
-	}
+	entities_max_items2=dxf_entities.count("  0");
+	entities_max_items3=dxf_entities.count("  0");
 
+	entities_max_items=entities_max_items+entities_max_items2+entities_max_items3;
+
 	entities_max_count=dxf_entities.count();
 
 	Signal_log1.clear();

Modified: branches/DXFtoQET3_DB/dxftoqet3db.h
===================================================================
--- branches/DXFtoQET3_DB/dxftoqet3db.h	2017-03-14 16:40:41 UTC (rev 4930)
+++ branches/DXFtoQET3_DB/dxftoqet3db.h	2017-03-16 22:39:06 UTC (rev 4931)
@@ -136,10 +136,20 @@
 		int64_t count_thumbnailimage_item;
 
 		int64_t header_max_items;
+		int64_t header_max_items2;
+		int64_t header_max_items3;
 		int64_t classes_max_items;
+		int64_t classes_max_items2;
+		int64_t classes_max_items3;
 		int64_t tables_max_items;
+		int64_t tables_max_items2;
+		int64_t tables_max_items3;
 		int64_t blocks_max_items;
+		int64_t blocks_max_items2;
+		int64_t blocks_max_items3;
 		int64_t entities_max_items;
+		int64_t entities_max_items2;
+		int64_t entities_max_items3;
 		int64_t objects_max_items;
 		int64_t thumbnailimage_max_items;
 

Modified: branches/DXFtoQET3_DB/src/ELMT_steps/elmt_block_level2.cpp
===================================================================
--- branches/DXFtoQET3_DB/src/ELMT_steps/elmt_block_level2.cpp	2017-03-14 16:40:41 UTC (rev 4930)
+++ branches/DXFtoQET3_DB/src/ELMT_steps/elmt_block_level2.cpp	2017-03-16 22:39:06 UTC (rev 4931)
@@ -38,7 +38,7 @@
 	DXF_Block_Value="";
 	Block_count=-1;
 
-	QSqlQuery NewQuery("SELECT * FROM dxf_blocks");
+	QSqlQuery NewQuery4("SELECT * FROM dxf_blocks");
 
 
 
@@ -65,10 +65,10 @@
 
 	//QSqlRecord Record2=NewQuery.record();
 
-	while (NewQuery.next() and end_block==0)
+	while (NewQuery4.next() and end_block==0)
 	{
 
-		QSqlRecord Record2=NewQuery.record();
+		QSqlRecord Record2=NewQuery4.record();
 		Recordvalue=Record2.value("Command").toString();
 
 		Signal_waarde1.clear();
@@ -101,12 +101,12 @@
 
 			while (end_block==0)
 			{
-				read_error2 = NewQuery.next();
+				read_error2 = NewQuery4.next();
 				if (read_error2==false)
 				{
 					end_block++;
 				}
-				QSqlRecord Record3=NewQuery.record();
+				QSqlRecord Record3=NewQuery4.record();
 
 				if (Record3.value("Command").toString()=="LINE" and Record3.value("Command_count").toInt()==0)
 				{
@@ -117,8 +117,8 @@
 
 
 					New_DXF_Line.QET_x1=(Record3.value("dxf_10").toDouble()*Block_scale_x)+Block_X;
-					New_DXF_Line.QET_x2=(Record3.value("dxf_11").toDouble()*Block_scale_y)+Block_Y;
-					New_DXF_Line.QET_y1=(Record3.value("dxf_20").toDouble()*Block_scale_x)+Block_X;
+					New_DXF_Line.QET_x2=(Record3.value("dxf_11").toDouble()*Block_scale_x)+Block_X;
+					New_DXF_Line.QET_y1=(Record3.value("dxf_20").toDouble()*Block_scale_y)+Block_Y;
 					New_DXF_Line.QET_y2=(Record3.value("dxf_21").toDouble()*Block_scale_y)+Block_Y;
 
 					New_DXF_Line.QET_layer=Record3.value("dxf_8").toString();
@@ -422,8 +422,8 @@
 
 					while (end_seqend==0 and count_vertex<QET_L_POLYLINE)
 					{
-						NewQuery.next();
-						QSqlRecord Record4=NewQuery.record();
+						NewQuery4.next();
+						QSqlRecord Record4=NewQuery4.record();
 						//Recordvalue2=Record4.value("Command").toString();
 
 						if (Record4.value("Command").toString()=="VERTEX" and Record4.value("Command_count").toInt()==0)
@@ -549,8 +549,8 @@
 
 					while (end_lwpoly==0 and count_vertex<max_vertex-1)
 					{
-						NewQuery.next();
-						QSqlRecord Record4=NewQuery.record();
+						NewQuery4.next();
+						QSqlRecord Record4=NewQuery4.record();
 						//Recordvalue2=Record4.value("Command").toString();
 
 						if (Record3.value("Command").toString()=="LWPOLYLINE" and max_vertex<QET_L_POLYLINE)
@@ -687,7 +687,7 @@
 		}
 		else
 		{
-			NewQuery.next();
+			//NewQuery.next();
 		}
 	}
 

Modified: branches/DXFtoQET3_DB/src/ELMT_steps/elmt_blocks.cpp
===================================================================
--- branches/DXFtoQET3_DB/src/ELMT_steps/elmt_blocks.cpp	2017-03-14 16:40:41 UTC (rev 4930)
+++ branches/DXFtoQET3_DB/src/ELMT_steps/elmt_blocks.cpp	2017-03-16 22:39:06 UTC (rev 4931)
@@ -23,13 +23,13 @@
 	DXF_main_base[0].QDXF_block_circle_color="blue";
 	DXF_main_base[0].QDXF_block_ellipse_color="blue";
 	DXF_main_base[0].QDXF_block_input_color="blue";
-	DXF_main_base[0].QDXF_block_line_color="blue";
-	DXF_main_base[0].QDXF_block_lwpolyline_color="blue";
-	DXF_main_base[0].QDXF_block_polyline_color="blue";
+	DXF_main_base[0].QDXF_block_line_color="cyan";
+	DXF_main_base[0].QDXF_block_lwpolyline_color="red";
+	DXF_main_base[0].QDXF_block_polyline_color="green";
 	DXF_main_base[0].QDXF_block_rectangel_color="blue";
 	DXF_main_base[0].QDXF_block_terminal_color="blue";
 	DXF_main_base[0].QDXF_block_text_color="blue";
-	DXF_main_base[0].QDXF_block_solid_color="blue";
+	DXF_main_base[0].QDXF_block_solid_color="magenta";
 
 	xcount=0;
 	Logtext="";
@@ -38,7 +38,7 @@
 	DXF_Block_Value="";
 	Block_count=-1;
 
-	QSqlQuery NewQuery("SELECT * FROM dxf_blocks");
+	QSqlQuery NewQueryBlock("SELECT * FROM dxf_blocks");
 
 
 
@@ -70,10 +70,10 @@
 
 	//QSqlRecord Record2=NewQuery.record();
 
-	while (NewQuery.next() and end_block==0)
+	while (NewQueryBlock.next() and end_block==0)
 	{
 
-		QSqlRecord Record2=NewQuery.record();
+		QSqlRecord Record2=NewQueryBlock.record();
 		Recordvalue=Record2.value("Command").toString();
 
 		Block_recod_count++;
@@ -110,12 +110,12 @@
 
 			while (end_block==0)
 			{
-				read_error1= NewQuery.next();
+				read_error1= NewQueryBlock.next();
 				if (read_error1==false)
 				{
 					end_block++;
 				}
-				QSqlRecord Record3=NewQuery.record();
+				QSqlRecord Record3=NewQueryBlock.record();
 
 				Block_recod_count++;
 
@@ -122,11 +122,11 @@
 				Signal_waarde1.clear();
 				Signal_waarde1.append(QET_handle);
 				Signal_waarde1.append(" : ");
-				Signal_waarde1.append(Record2.value("Command").toString());
+				Signal_waarde1.append(Record3.value("Command").toString());
 				Signal_waarde1.append(" : ");
-				Signal_waarde1.append(Record2.value("dxf_5").toString());
+				Signal_waarde1.append(Record3.value("dxf_5").toString());
 				Signal_waarde1.append(" : ");
-				Signal_waarde1.append(Record3.value("Command_count").toInt());
+				Signal_waarde1.append(Record3.value("Command_count").toString());
 
 				emit Signal1(Signal_waarde1);
 
@@ -139,8 +139,8 @@
 
 
 					New_DXF_Line.QET_x1=(Record3.value("dxf_10").toDouble()*Block_scale_x)+Block_X;
-					New_DXF_Line.QET_x2=(Record3.value("dxf_11").toDouble()*Block_scale_y)+Block_Y;
-					New_DXF_Line.QET_y1=(Record3.value("dxf_20").toDouble()*Block_scale_x)+Block_X;
+					New_DXF_Line.QET_x2=(Record3.value("dxf_11").toDouble()*Block_scale_x)+Block_X;
+					New_DXF_Line.QET_y1=(Record3.value("dxf_20").toDouble()*Block_scale_y)+Block_Y;
 					New_DXF_Line.QET_y2=(Record3.value("dxf_21").toDouble()*Block_scale_y)+Block_Y;
 
 					New_DXF_Line.QET_layer=Record3.value("dxf_8").toString();
@@ -446,8 +446,8 @@
 
 					while (end_seqend==0 and count_vertex<QET_L_POLYLINE)
 					{
-						NewQuery.next();
-						QSqlRecord Record4=NewQuery.record();
+						NewQueryBlock.next();
+						QSqlRecord Record4=NewQueryBlock.record();
 						//Recordvalue2=Record4.value("Command").toString();
 
 						if (Record4.value("Command").toString()=="VERTEX" and Record4.value("Command_count").toInt()==0)
@@ -576,8 +576,8 @@
 
 					while (end_lwpoly==0 and count_vertex<max_vertex-1)
 					{
-						NewQuery.next();
-						QSqlRecord Record4=NewQuery.record();
+						NewQueryBlock.next();
+						QSqlRecord Record4=NewQueryBlock.record();
 						//Recordvalue2=Record4.value("Command").toString();
 
 						if (Record3.value("Command").toString()=="LWPOLYLINE" and max_vertex<QET_L_POLYLINE)
@@ -713,7 +713,7 @@
 		}
 		else
 		{
-			NewQuery.next();
+			//NewQueryBlock.next();
 		}
 	}
 


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