|
@@ -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;
|
|
|
+// }
|
|
|
+// }
|
|
|
//}
|