V6.7.5_beta
This commit is contained in:
+30
-13
@@ -50,7 +50,6 @@ MainWidget::MainWidget(QWidget* parent)
|
||||
m_MainBtn = ui.m_MainBtn;
|
||||
m_ManageBtn = ui.m_ManageBtn;
|
||||
m_MsgBtn = ui.m_MsgBtn;
|
||||
// m_TextEdit = ui.m_TextEdit;
|
||||
m_PrintDisplay = ui.widgetPrintTextDisplay;
|
||||
m_CloseBtn = ui.m_CloseBtn;
|
||||
m_StopBtn = ui.m_StopBtn;
|
||||
@@ -170,12 +169,23 @@ void MySleep(unsigned int msec)
|
||||
|
||||
}
|
||||
|
||||
void MainWidget::bindTxTEdit(QTextEdit* textEdit){
|
||||
m_textEdit = textEdit;
|
||||
}
|
||||
bool MainWidget::generatePrintContent(PicScene *scene)
|
||||
{
|
||||
if(!scene) {
|
||||
qWarning() << "Scene is empty!";
|
||||
return false;
|
||||
}
|
||||
|
||||
void MainWidget::bindPicScene(PicScene* pPicScene){
|
||||
this->pPicScene = pPicScene;
|
||||
if(this->pPicScene) {
|
||||
pPicScene->deleteLater();
|
||||
pPicScene = nullptr;
|
||||
}
|
||||
|
||||
this->pPicScene = scene;
|
||||
onPreviewScene();
|
||||
|
||||
// SendPrintDataToFpga(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
void MainWidget::bindSysPara(SysPara *sysPara){
|
||||
@@ -739,7 +749,7 @@ void MainWidget::on_m_StartBtn_clicked()
|
||||
/******2020/2/29*****/
|
||||
if(sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) //同步模式下,判断喷印间隔是否设置合理
|
||||
{
|
||||
QSizeF size = m_textEdit->document()->size();
|
||||
QSizeF size = QSizeF(sysPara->status.currPrintCol, sysPara->status.currPrintRow);
|
||||
float stroke,print_len_min;
|
||||
stroke = sysPara->para.printColDelay/sysPara->para.synPulseNumPerMm;
|
||||
print_len_min = stroke * size.width();
|
||||
@@ -897,7 +907,7 @@ void MainWidget::SendPrintDataToFpga(unsigned char alterMode, int startCol, int
|
||||
Q_UNUSED(alterMode);
|
||||
|
||||
// 看清楚,最后取反,也就是说,如果不是局部更新,则写入打印设置和变量控制
|
||||
if(!(startCol >= 0 && size > 0 && size - startCol >= 1)) {
|
||||
if(!(startCol >= 0 && size > 0)) {
|
||||
sysPara->devOp->writeFpgaPrintPara(1);
|
||||
sysPara->devOp->writeFpgaVariCtrl();
|
||||
startCol = 0;
|
||||
@@ -1815,6 +1825,11 @@ int MainWidget::getMaxSpeedCalcPara(){
|
||||
void MainWidget::onPreviewScene()
|
||||
{
|
||||
sysPara->para.EditMode = SCENE;
|
||||
|
||||
if(!pPicScene) {
|
||||
return;
|
||||
}
|
||||
|
||||
pPicScene->clearSelection();
|
||||
|
||||
QRect sceneRect = pPicScene->itemsBoundingRect().toRect();
|
||||
@@ -2364,15 +2379,17 @@ void MainWidget::handleEmptySize()
|
||||
// 初始化空场景的尺寸(默认适配打印最大尺寸,避免界面空白)
|
||||
bool MaxCol4000 = sysPara->status.flagOfNo67FPGA ? true : false;
|
||||
QSize emptySize(MaxCol4000 ? MAX_PRINT_COL_NUM_Normal : MAX_PRINT_COL_NUM_Wide, MAX_PRINT_ROW_NUM);
|
||||
QImage emptyImage(emptySize, QImage::Format_ARGB32);
|
||||
emptyImage.fill(0x00ffffff); // 填充白色背景,与正常场景渲染一致
|
||||
QPainter emptyPainter(&emptyImage);
|
||||
pPicScene->render(&emptyPainter, QRectF(), QRectF(0, 0, emptySize.width(), emptySize.height()));
|
||||
|
||||
// 不是,渲染这个有什么用处吗?byons@2026年7月21日
|
||||
// QImage emptyImage(emptySize, QImage::Format_ARGB32);
|
||||
// emptyImage.fill(0x00ffffff); // 填充白色背景,与正常场景渲染一致
|
||||
// QPainter emptyPainter(&emptyImage);
|
||||
// pPicScene->render(&emptyPainter, QRectF(), QRectF(0, 0, emptySize.width(), emptySize.height()));
|
||||
|
||||
// 初始化打印参数,避免空场景导致的参数异常
|
||||
previewFlag = 1;
|
||||
sysPara->status.currPrintRow = 0;
|
||||
sysPara->status.currPrintCol = emptySize.width();
|
||||
sysPara->status.currPrintCol = 0; // emptySize.width();
|
||||
sysPara->status.variNum = 0;
|
||||
sysPara->status.QRvariNum = 0;
|
||||
sysPara->status.ExpiryVarNum = 0;
|
||||
|
||||
Reference in New Issue
Block a user