示例#1
0
bool Ccl1000::UpdateFinalImage(void) {


    Cce515p::UpdateFinalImage();

    QPainter painter;
    painter.begin(FinalImage);

    float ratio = ( (float) paperWidget->width() ) / ( paperWidget->bufferImage->width() - paperWidget->getOffset().x() );

    QRect source = QRect( QPoint(paperWidget->getOffset().x() ,
                                 paperWidget->getOffset().y()  - paperWidget->height() / ratio ) ,
                          QPoint(paperWidget->bufferImage->width(),
                                 paperWidget->getOffset().y() +10)
                        );
//    MSG_ERROR(QString("%1 - %2").arg(source.width()).arg(PaperPos().width()));
    painter.drawImage(PaperPos(),
                      paperWidget->bufferImage->copy(source).scaled(PaperPos().size(),Qt::IgnoreAspectRatio, Qt::SmoothTransformation )
                     );

//    painter.setOpacity(0.5);
//    painter.fillRect(PaperPos(),Qt::black);
//    painter.setOpacity(1);

//    painter.drawImage(112,145,*capot);

//    int offset = (lastX ) * ratio /( mainwindow->zoom/100);
//    painter.drawImage(152+offset,178,*head);       // Draw head
//    painter.drawImage(793 - offset,214,*cable);    // Draw cable
//    qWarning()<<"update";

    painter.end();

    return true;
}
示例#2
0
bool Chp82143A::init(void) {

    Cprinter::init();

    charTable = new QImage(P_RES(":/ext/ce126ptable.bmp"));
    charsize = 1;

    pCONNECTOR = new Cconnector(this,64,0,Cconnector::hp41,"hp41 Module",true,QPoint(631,468));
    publish(pCONNECTOR);

    if(pKEYB)	pKEYB->init();
    if(pTIMER)	pTIMER->init();

    // Create  Paper Image
    // The final paper image is 207 x 149 at (277,0) for the ce125
    printerbuf	= new QImage(QSize(paperWidth, 3000),QImage::Format_ARGB32);
    printerdisplay= new QImage(QSize(paperWidth, 250),QImage::Format_ARGB32);

    paperWidget = new CpaperWidget(PaperPos(),printerbuf,this);
    paperWidget->hide();
//    paperWidget->show();
//    paperWidget->hide();

    // Fill it blank
    clearPaper();

    settop(10);
    setposX(0);

    isready = true;
    return true;
}
示例#3
0
bool Cpc2021::init(void)
{
    CPObject::init();

    setfrequency( 0);

    pCONNECTOR	= new Cconnector(this,
                                 9,
                                 0,
                                 Cconnector::DIN_8,
                                 "Printer connector",
                                 true,
                                 QPoint(386,238),
                                 Cconnector::EAST);
    publish(pCONNECTOR);
    WatchPoint.add(&pCONNECTOR_value,64,11,this,"Printer connector");
    AddLog(LOG_PRINTER,tr("PRT initializing..."));

    if(pKEYB)	pKEYB->init();
    if(pTIMER)	pTIMER->init();

    // Create CE-126 Paper Image
    // The final paper image is 207 x 149 at (277,0) for the ce125
    pc2021buf	= new QImage(QSize(170, 3000),QImage::Format_ARGB32);
    pc2021display= new QImage(QSize(170, 149),QImage::Format_ARGB32);


//TODO Update the chartable with upd16343 char table
    charTable = new QImage(P_RES(":/ext/ce126ptable.bmp"));

//	bells	 = new QSound("ce.wav");

// Create a paper widget

    paperWidget = new CpaperWidget(PaperPos(),pc2021buf,this);
    paperWidget->updated = true;
    paperWidget->show();

    // Fill it blank
    clearPaper();

    run_oldstate = -1;

    return true;
}
示例#4
0
bool Cce122::init(void)
{
    Cce126::init();

    setfrequency( 0);
    remove(pCONNECTOR); delete pCONNECTOR;
    pCONNECTOR	= new Cconnector(this,9,0,Cconnector::Sharp_9,"Connector 9 pins",true,QPoint(372,107));	publish(pCONNECTOR);

    WatchPoint.add(&pCONNECTOR_value,64,9,this,"Standard 11pins connector");
    WatchPoint.add(&pTAPECONNECTOR_value,64,2,this,"Line In / Rec");

    AddLog(LOG_PRINTER,tr("PRT initializing..."));

    if(pKEYB)	pKEYB->init();
    if(pTIMER)	pTIMER->init();

    // Create CE-122 Paper Image
    // The final paper image is 207 x 149 at (277,0) for the ce125
    ce126buf	= new QImage(QSize(130, 3000),QImage::Format_ARGB32);
    ce126display= new QImage(QSize(130, 149),QImage::Format_ARGB32);
    margin = 5;



    charTable = new QImage(P_RES(":/ext/ce122table.bmp"));

//	bells	 = new QSound("ce.wav");

// Create a paper widget

    paperWidget = new CpaperWidget(PaperPos(),ce126buf,this);
    paperWidget->updated = true;
    paperWidget->show();

    // Fill it blank
    clearPaper();



    return true;
}