Explorar el Código

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	CGH_Printer.vcxproj.user
#	Include/ui_CGH_Printer.h
#	PrintThread.cpp
DESKTOP-55AB90D\user hace 2 años
padre
commit
523a2a8d82
Se han modificado 10 ficheros con 879 adiciones y 3912 borrados
  1. 9 8
      CGH_Printer.cpp
  2. 405 1005
      CGH_Printer.ui
  3. 1 1
      CGH_Printer.vcxproj
  4. 3 3
      CGH_Printer.vcxproj.filters
  5. 4 4
      CGH_Printer.vcxproj.user
  6. 1 4
      Configure/Configure.txt
  7. 0 0
      Include/resource.h
  8. 325 931
      Include/ui_CGH_Printer.h
  9. 131 92
      PrintThread.cpp
  10. 0 1864
      ui_CGH_Printer.h

+ 9 - 8
CGH_Printer.cpp

@@ -265,10 +265,11 @@ void CGH_Printer::ReadConfigure()
     infile.close();
 
     // 参数设置
-    ui.lineEditMoveUp->setText(QString::fromStdString(maps_Configure["前"]));
-    ui.lineEditMoveDown->setText(QString::fromStdString(maps_Configure["后"]));
-    ui.lineEditMoveLeft->setText(QString::fromStdString(maps_Configure["左"]));
-    ui.lineEditMoveRight->setText(QString::fromStdString(maps_Configure["右"]));
+    //ui.lineEditMoveUp->setText(QString::fromStdString(maps_Configure["前"]));
+    //ui.lineEditMoveDown->setText(QString::fromStdString(maps_Configure["后"]));
+    //ui.lineEditMoveLeft->setText(QString::fromStdString(maps_Configure["左"]));
+    //ui.lineEditMoveRight->setText(QString::fromStdString(maps_Configure["右"]));
+    ui.lineEditMove->setText(QString::fromStdString(maps_Configure["位移"]));
     ui.lineEditShutter->setText(QString::fromStdString(maps_Configure["时间"]));
 
     ReadTransTableConfigue();
@@ -476,7 +477,7 @@ void CGH_Printer::MoveUp()
 {
     if (curTransTableState)
     {
-        double offset = ui.lineEditMoveUp->text().toDouble();
+        double offset = ui.lineEditMove->text().toDouble();
         offset = -1 * offset;
 
         if (!PI_MVR(Devices[1], sAxis.c_str(), &offset))
@@ -502,7 +503,7 @@ void CGH_Printer::MoveDown()
 {
     if (curTransTableState)
     {
-        double offset = ui.lineEditMoveDown->text().toDouble();
+        double offset = ui.lineEditMove->text().toDouble();
 
         if (!PI_MVR(Devices[1], sAxis.c_str(), &offset))
         {
@@ -528,7 +529,7 @@ void CGH_Printer::MoveLeft()
 {
     if (curTransTableState)
     {
-        double offset = ui.lineEditMoveLeft->text().toDouble();
+        double offset = ui.lineEditMove->text().toDouble();
 
         if (!PI_MVR(Devices[0], sAxis.c_str(), &offset))
         {
@@ -554,7 +555,7 @@ void CGH_Printer::MoveRight()
 {
     if (curTransTableState)
     {
-        double offset = ui.lineEditMoveRight->text().toDouble();
+        double offset = ui.lineEditMove->text().toDouble();
         offset = -1 * offset;
 
         if (!PI_MVR(Devices[0], sAxis.c_str(), &offset))

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 405 - 1005
CGH_Printer.ui


+ 1 - 1
CGH_Printer.vcxproj

@@ -237,10 +237,10 @@
     <QtMoc Include="Include\CGH_Printer.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="Include\resource.h" />
     <ClInclude Include="Include\SerialPort.h" />
     <ClInclude Include="Include\ui_CGH_Printer.h" />
     <ClInclude Include="Include\ui_CGH_ProjectView.h" />
-    <ClInclude Include="resource.h" />
     <QtMoc Include="Include\CGH_CheckStateThread.h" />
     <QtMoc Include="Include\CGH_CoordinateThread.h" />
     <ClInclude Include="Include\CGH_Project.h" />

+ 3 - 3
CGH_Printer.vcxproj.filters

@@ -110,13 +110,13 @@
     <ClInclude Include="Include\ui_CGH_ProjectView.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Include\ui_CGH_Printer.h">
+    <ClInclude Include="Include\SerialPort.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="resource.h">
+    <ClInclude Include="Include\resource.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Include\SerialPort.h">
+    <ClInclude Include="Include\ui_CGH_Printer.h">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>

+ 4 - 4
CGH_Printer.vcxproj.user

@@ -2,15 +2,15 @@
 <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup />
   <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <QtLastBackgroundBuild>2022-11-25T03:46:47.7073893Z</QtLastBackgroundBuild>
+    <QtLastBackgroundBuild>2022-12-08T11:35:50.5996402Z</QtLastBackgroundBuild>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="QtSettings">
-    <QtLastBackgroundBuild>2022-11-25T03:46:47.8338945Z</QtLastBackgroundBuild>
+    <QtLastBackgroundBuild>2022-12-08T11:35:50.7354092Z</QtLastBackgroundBuild>
   </PropertyGroup>
   <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <QtLastBackgroundBuild>2022-11-25T03:46:47.9609238Z</QtLastBackgroundBuild>
+    <QtLastBackgroundBuild>2022-12-08T11:35:50.8457378Z</QtLastBackgroundBuild>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="QtSettings">
-    <QtLastBackgroundBuild>2022-11-25T03:46:48.0870861Z</QtLastBackgroundBuild>
+    <QtLastBackgroundBuild>2022-12-08T11:35:50.9357384Z</QtLastBackgroundBuild>
   </PropertyGroup>
 </Project>

+ 1 - 4
Configure/Configure.txt

@@ -1,5 +1,2 @@
-前 10.0000
-后 10.0000
-左 10.0000
-右 10.0000
+位移 10.0000
 时间 10000

resource.h → Include/resource.h


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 325 - 931
Include/ui_CGH_Printer.h


+ 131 - 92
PrintThread.cpp

@@ -55,6 +55,7 @@ void PrintThread::run()
 }
 
 
+// 从左向右单方向打印
 void PrintThread::Print()
 {
 	PRINTSTOP = FALSE;
@@ -88,8 +89,8 @@ void PrintThread::Print()
 
 		QCoreApplication::processEvents();
 	}
-	// 开始打印任务 
-	//之前是s型路径打印 现在换成了从左往右的单向打印
+
+	// 开始打印任务
 	int LL, CC;
 	string Format = ".bmp";
 	string sep = "/";
@@ -156,94 +157,132 @@ void PrintThread::Print()
 	}
 }
 
-	// // 开始打印任务
-	//int LL, CC, KK;
-	//string Format = ".bmp";
-	//string sep = "/";
-	//string Filename, PrintFullname;
-	//string midl, midr;
-	//OffsetY = PrintLSpacing;
-	//for (LL = 1; LL <= PrintLine; LL++)
-	//{
-	//	midl = numberToString(LL);
-
-	//	for (CC = 1; CC <= PrintColumn; CC++)
-	//	{
-	//		if (LL % 2 == 1)
-	//		{
-	//			KK = CC;
-	//			midr = numberToString(KK);
-	//		}
-	//		else
-	//		{
-	//			KK = PrintColumn - CC + 1;
-	//			midr = numberToString(KK);
-	//		}
-
-	//		Filename = PrintPrefix + midl + midr + Format;
-	//		PrintFullname = PrintResource + sep + Filename;
-
-	//		if (LL % 2 == 1)
-	//		{
-	//			OffsetX = PrintCSpacing;
-	//			PI_MVR(Devices[0], sAxis.c_str(), &OffsetX);
-	//		}
-	//		else
-	//		{
-	//			OffsetX = -1 * PrintCSpacing;
-	//			PI_MVR(Devices[0], sAxis.c_str(), &OffsetX);
-	//		}
-
-	//		isMoving_sAxisX = TRUE;
-	//		isMoving_sAxisY = TRUE;
-	//		while (isMoving_sAxisX || isMoving_sAxisY)
-	//		{
-	//			PI_IsMoving(Devices[0], sAxis.c_str(), &isMoving_sAxisX);
-	//			PI_IsMoving(Devices[1], sAxis.c_str(), &isMoving_sAxisY);
-
-	//			QCoreApplication::processEvents();
-	//		}
-
-	//		emit TransCGH(QString::fromStdString(PrintFullname));
-
-	//		Sleep(PrintQuiet);// 静台
-
-	//		MyShutter->open();
-	//		Sleep(PrintExpose);
-	//		MyShutter->close();
-
-	//		emit TransPrintProgress(LL, CC);
-
-	//		PRINTSTOP = m_Printer->Get_PRINTSTOP();
-	//		if (PRINTSTOP)
-	//		{
-	//			break;
-	//		}
-	//	}
-	//	if (LL % 2 == 1)
-	//	{
-	//		OffsetX = PrintCSpacing;
-	//		PI_MVR(Devices[0], sAxis.c_str(), &OffsetX);
-	//	}
-	//	else
-	//	{
-	//		OffsetX = -1 * PrintCSpacing;
-	//		PI_MVR(Devices[0], sAxis.c_str(), &OffsetX);
-	//	}
-	//	PI_MVR(Devices[1], sAxis.c_str(), &OffsetY);
-
-	//	isMoving_sAxisX = TRUE;
-	//	isMoving_sAxisY = TRUE;
-	//	while (isMoving_sAxisX || isMoving_sAxisY)
-	//	{
-	//		PI_IsMoving(Devices[0], sAxis.c_str(), &isMoving_sAxisX);
-	//		PI_IsMoving(Devices[1], sAxis.c_str(), &isMoving_sAxisY);
-
-	//		QCoreApplication::processEvents();
-	//	}
-	//	if (PRINTSTOP)
-	//	{
-	//		break;
-	//	}
-	//}
+
+// “S”型路径打印
+//void PrintThread::Print()
+//{
+//	PRINTSTOP = FALSE;
+//
+//	// 主线程参数传递到子线程
+//	Devices = m_Printer->Get_Devices();
+//	sAxis = m_Printer->Get_sAxis();
+//	PrintLSpacing = m_Printer->Get_PrintLSpacing();
+//	PrintCSpacing = m_Printer->Get_PrintCSpacing();
+//	PrintLine = m_Printer->Get_PrintLine();
+//	PrintColumn = m_Printer->Get_PrintColumn();
+//	PrintPrefix = m_Printer->Get_PrintPrefix();
+//	PrintExpose = m_Printer->Get_PrintExpose();
+//	PrintQuiet = m_Printer->Get_PrintQuiet();
+//	PrintResource = m_Printer->Get_PrintResource();
+//
+//	// 平移台
+//	HoloLine = PrintLSpacing * PrintLine;
+//	HoloColumn = PrintCSpacing * PrintColumn;
+//	initPrintX = -(HoloColumn + PrintCSpacing) / 2;
+//	initPrintY = -(HoloLine - PrintLSpacing) / 2;
+//	PI_MOV(Devices[0], sAxis.c_str(), &initPrintX);
+//	PI_MOV(Devices[1], sAxis.c_str(), &initPrintY);
+//
+//	BOOL isMoving_sAxisX = TRUE;
+//	BOOL isMoving_sAxisY = TRUE;
+//	while (isMoving_sAxisX || isMoving_sAxisY)
+//	{
+//		PI_IsMoving(Devices[0], sAxis.c_str(), &isMoving_sAxisX);
+//		PI_IsMoving(Devices[1], sAxis.c_str(), &isMoving_sAxisY);
+//
+//		QCoreApplication::processEvents();
+//	}
+//
+//	 // 开始打印任务
+//	int LL, CC, KK;
+//	string Format = ".bmp";
+//	string sep = "/";
+//	string Filename, PrintFullname;
+//	string midl, midr;
+//	OffsetY = PrintLSpacing;
+//	for (LL = 1; LL <= PrintLine; LL++)
+//	{
+//		midl = numberToString(LL);
+//
+//		for (CC = 1; CC <= PrintColumn; CC++)
+//		{
+//			if (LL % 2 == 1)
+//			{
+//				KK = CC;
+//				midr = numberToString(KK);
+//			}
+//			else
+//			{
+//				KK = PrintColumn - CC + 1;
+//				midr = numberToString(KK);
+//			}
+//
+//			Filename = PrintPrefix + midl + midr + Format;
+//			PrintFullname = PrintResource + sep + Filename;
+//
+//			if (LL % 2 == 1)
+//			{
+//				OffsetX = PrintCSpacing;
+//				PI_MVR(Devices[0], sAxis.c_str(), &OffsetX);
+//			}
+//			else
+//			{
+//				OffsetX = -1 * PrintCSpacing;
+//				PI_MVR(Devices[0], sAxis.c_str(), &OffsetX);
+//			}
+//
+//			isMoving_sAxisX = TRUE;
+//			isMoving_sAxisY = TRUE;
+//			while (isMoving_sAxisX || isMoving_sAxisY)
+//			{
+//				PI_IsMoving(Devices[0], sAxis.c_str(), &isMoving_sAxisX);
+//				PI_IsMoving(Devices[1], sAxis.c_str(), &isMoving_sAxisY);
+//
+//				QCoreApplication::processEvents();
+//			}
+//
+//			emit TransCGH(QString::fromStdString(PrintFullname));
+//
+//			Sleep(PrintQuiet);// 静台
+//
+//			MyShutter->open();
+//			Sleep(PrintExpose);
+//			MyShutter->close();
+//
+//			emit TransPrintProgress(LL, CC);
+//
+//			PRINTSTOP = m_Printer->Get_PRINTSTOP();
+//			if (PRINTSTOP)
+//			{
+//				break;
+//			}
+//		}
+//		if (LL % 2 == 1)
+//		{
+//			OffsetX = PrintCSpacing;
+//			PI_MVR(Devices[0], sAxis.c_str(), &OffsetX);
+//		}
+//		else
+//		{
+//			OffsetX = -1 * PrintCSpacing;
+//			PI_MVR(Devices[0], sAxis.c_str(), &OffsetX);
+//		}
+//
+//
+//		PI_MVR(Devices[1], sAxis.c_str(), &OffsetY);
+//
+//		isMoving_sAxisX = TRUE;
+//		isMoving_sAxisY = TRUE;
+//		while (isMoving_sAxisX || isMoving_sAxisY)
+//		{
+//			PI_IsMoving(Devices[0], sAxis.c_str(), &isMoving_sAxisX);
+//			PI_IsMoving(Devices[1], sAxis.c_str(), &isMoving_sAxisY);
+//
+//			QCoreApplication::processEvents();
+//		}
+//		if (PRINTSTOP)
+//		{
+//			break;
+//		}
+//	}
 //}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 1864
ui_CGH_Printer.h