ãã®èšäºã§ã¯ãQt5ã§3Dããªã³ã¿ãŒã管çããããã®ããªãŒãœãããŠã§ã¢ã®éçºçµéšãRepRap'amiãšã®éä¿¡ã®åé¡ãšæ©èœããã®ä»ã®åã³ã«ã€ããŠã話ããããšæããŸãã
ãã®çµéšã®çµæãã3Dããªã³ã¿ãŒçšã®æå°éã®ç¡æãã¹ãã³ã³ãããŒã©ãŒã§ããRepRaptorã§ãã
ç«ã®äžã«èå³ã®ãã人ãæåŸ ããŸãã
ã¡ãã£ãšããèæ¯
éå»1幎éãç§ã¯3Dããªã³ãã£ã³ã°ã«éåžžã«èå³ãæã¡ã3Dããªã³ãã£ã³ã°ã ãã§ãªããç¡æã®ã³ã³ããŒãã³ãã§ããRepRapãããžã§ã¯ãã«ãèå³ãæã¡ãŸããã 倧åŠã®ãªãŒããŒã·ãããäºæ¥ãæ¯æŽããä»å¹Žäžã«MSTU MIREAã§ã®ç§ã®èããšåæ§ã®åªåã3Då°å·ã©ããéèšããŸããã
ããã«åé¡ãçºçããŸãã-æ¢åã®ãœãããŠã§ã¢ãšã³ã·ã¹ãã ã«ã¯ãäœæ¥ã«å€§ããå¹²æžããæ¬ é¥ããããŸããã ãããã£ãŠãç¬èªã®ãœãããŠã§ã¢ãäœæããããšã«ããããããã®åé¡ã解æ¶ããããšã決å®ãããŸããã
æ¢åã®ãœãããŠã§ã¢ã®äœè ãäžæ³šæã«æãããªãããã«ãç¹ã«å€ãã®ç¡æã®3Då°å·ãœãããŠã§ã¢ã«ã¯å ±éã®åé¡ããããããæãçªãããšã¯ããŸããã
- ãããã¯ãã¹ãŠã€ã³ã¿ããªã¿èšèªã§æžãããŠããã匱ãããŒããŠã§ã¢ã§ãã¡ã€ã«ãéããŠè§£æããã®ã«10åãããããšããããŸãã
- Monoã§æžããããã®ãå®æçã«èœã¡ãŠãããããã®ãã©ã¹ããã¯ãæ©æ¥ã«çµããããŸãïŒããããMonoèªäœã®ããã§ã¯ãªããäœè ããã®ã¢ã»ã³ããªãžã®æå°éã®æ³šæã§ãïŒã
- ã€ã³ã¿ãŒãã§ã€ã¹ã«ã¯ã»ãšãã©ã³ãŒããäœæãããŠããŸããããå®å šã«åé·ãªæ©èœããããŸãïŒããããªãºã ããforã³ããŸãïŒã
Qtãéžã¶çç±
ããããã¹ãŠä¿®æ£ããæ¹æ³ã¯ïŒ ããé«éã«åäœããã§ããã ãã·ã³ãã«ã«ããèšèªã§ãã¹ããèšè¿°ããã®ã¯éåžžã«ç°¡åã§ãã ããã«èšã£ãŠãã£ãã Qtã¯å¶ç¶ã§ã¯ãªãéçºçšã«éžã°ããŸããã ãã®ãã°ããããã¬ãŒã ã¯ãŒã¯ã¯èªç±ã«é åžãããã ãã§ãªããC ++ã®çã¿ã䌎ããã«ããã©ãããã©ãŒã ãªãã§ã¯ãã¹ãã©ãããã©ãŒã ã¢ããªã±ãŒã·ã§ã³ãäœæããããšãã§ããŸãããŸããæè¿ç§ãå®æçã«äœ¿çšããQSerialPortããã¬ãŒã ã¯ãŒã¯ã®å ¬åŒéšåã«ãªããŸããã
ããã«ãQtCreatorã»ã©é«éã§äŸ¿å©ãªIDEãç¥ããŸããã
ãã¹ãŠã®ãŠã£ã³ããŠãããã³Uièªäœã¯Qt WSIWYGãšãã£ã¿ãŒã§.uiãã¡ã€ã«ã䜿çšããŠäœæãããŠãããããã€ã³ã¿ãŒãã§ã€ã¹ã«çŽæ¥é¢é£ãããã®ã¯ãã¹ãŠçç¥ããŸãã ãããŒãã®äžãã«ãªããŸãã
éå§å ŽæãŸãã¯ããªã³ã¿ãŒã®è©±ãæ¹
éä¿¡ããã«ã¯ãRepRapãããžã§ã¯ãã®ã³ãã¥ããã£ãé·ãéãããã³ã«ãšã³ãã³ãã®ãªã¹ãã決å®ããŠãããããããŸããŸãªããŒãïŒMelziãRAMPS 1.4ãTeensyluãGen7 1.5.1ãªã©ïŒã®åç©åå šäœã§äœæ¥ããå¿ èŠããããŸãã ä»»æã®ããŒããšéä¿¡ããã«ã¯ãã·ãªã¢ã«ããŒããšGã³ãŒããããã³ã«ã䜿çšãããŸãã
3Dããªã³ãã£ã³ã°ã©ãã§ã¯ãå人ãšç§ã¯Repetierãã¡ãŒã ãŠã§ã¢ã䜿çšããŠããŸããããã¯ãMarlinããã³Teacupãã¡ãŒã ãŠã§ã¢ãšãšãã«ãã»ãšãã©ã®æšæºã³ãŒãããµããŒãããŠããŸãã
æåã®å€±æã¯ãããã³ã«ã§ã
ã·ãªã¢ã«RS-232ããŒãã®ä»æ§ã¯åºç¯ã§èå³æ·±ããã®ã§ãããæ®å¿µãªãããå®å šã«äœ¿çšãããããšã¯ãã£ãã«ãããŸããã USBãä»ããŠã·ãªã¢ã«ããŒãããšãã¥ã¬ãŒãããå Žåãéåžžã«å€ãã®å ŽåãããŒã¿è»¢éãæ åœããTXããã³RXã©ã€ã³ã®ã¿ããã€ã¯ãã³ã³ãããŒã©ãŒã«æ¥ç¶ãããŸãã DTRïŒæ¥ç¶ãªã»ããïŒãªã©ã®åç·ã¯é垞䜿çšãããŸãããããã¯æ²ããããšã§ãã
ããŒããŠã§ã¢ããŒã¹ã®ããŒã¿è»¢éå¶åŸ¡ã®ä»£ããã«ãRepRapäºæããªã³ã¿ãŒã¯éåžžã«ã·ã³ãã«ãªPingPongãããã³ã«ã䜿çšããŸãã
- ããªã³ã¿ãŒã¯åçŽãªåŸ æ©ã©ã€ã³ãå ±åããŸãã
- ãã¹ãã¯ãæ¹è¡ã§çµããGã³ãŒãã³ãã³ããéä¿¡ããŸãã
- ããªã³ã¿ãŒã¯ã Ok <è¡çªå·>ãšããè¡ã§ã³ãã³ãã®åä¿¡ã確èªããŸãã
次ã®ããã«ãªããŸãã
åŸ ã£ãŠ
G1 X10 Y10 Z10
ããã£ã0
G1 X20 Y5 Z3
ããã£ã0
ãOKãã®åŸã«0ã«æ°ã¥ããŸãããïŒ ããã¯è¡çªå·ã§ãã å¿ èŠã«å¿ããŠããã§ãã¯ãµã ãšè¡çªå·ã䜿çšã§ããŸã
ããªã³ã¿ãŒã«ã³ãã³ããéä¿¡ããïŒ
N1 G1 X10 Y10 Z10 * cs
ããã£ã1
N2 G1 X20 Y5 Z3 * cs
ããã£ã2
csã¯ãæååã®èšç®ãããã³ã³ãããŒã«ã§ãã
ååãšããŠããã§ãã¯ãµã ãå°å·ããããã«3Dã¢ãã«ãGã³ãŒãã«å€æããã³ãŒããžã§ãã¬ãŒã¿ãŒã¯çæãããŸããããããã¯ãã¹ãã®è£éã«ä»»ãããŸãã
ããªã³ã¿ãŒã«ã¯ãããã¡ãŒãããããã®ãµã€ãºã¯ã»ãšãã©ã®å Žå16ã³ãã³ãã§ãã
ãããã³ã«å®è£
Qtã«ã¯éçºè ã®ç掻ã楜ã«ããåªããæ©èœããããŸã-ã·ã°ãã«ãšã¹ãããã
Signalã¯C ++ã®æ°ããæŠå¿µã§ãã ä¿¡å·ã¯ã¹ãããã®ãããªã¯ã©ã¹ã§å®£èšãããŸãïŒ
class Example : public QObject { Q_OBJECT public: Example(); signals: void exampleSignal(int); }
ã·ã°ãã«ã¯äœãè¿ãããšãã§ããªããããåžžã«voidåãæã¡ãåŒæ°ã®ä»£ããã«ã·ã°ãã«ã«ãã£ãŠéä¿¡ãããå€æ°ã®åã瀺ãããŸãã åæåããå¿ èŠã¯ãããŸããã
ã·ã°ãã«ã¯èŠªã¯ã©ã¹ã®ä»»æã®ã¡ãœããããåŒã³åºãããéåžžã«ç°¡åã§ãïŒ
emit exampleSignal(100);
ãã®ãããªåŒã³åºãã®åŸããã®ä¿¡å·ã«æ¥ç¶ããããã¹ãŠã®ã¹ãããã¯ãæ¥ç¶ã®é åºã§æãæ©ãæ©äŒã«åŒã³åºããã100ã®å€ãäžããããŸãã
ã¹ããããšã¯äœã§ããïŒ èŠããã«ãããã¯æãäžè¬çãªã¹ããã宣èšã¡ãœããã§ãã
class Example2 : public QObject { Q_OBJECT public: Example(); public slots: void exampleSlot(int); }
ä¿¡å·ãã¹ãããã«æ¥ç¶ããããšãéåžžã«ç°¡åã§ãã
Example e1; Example2 e2; connect(&e1, SIGNAL(exampleSignal(int)), &e2, SLOT(exampleSlot(int)));
å¶éããããŸã-ä¿¡å·ãšã¹ãããã¯éä¿¡ãããã¿ã€ããšäžèŽããå¿ èŠããããŸãã
ä¿¡å·ãšã¹ããããããã°ãã·ãªã¢ã«ããŒããä»ããéä¿¡çšã®éåæã¬ã·ãŒããŒ/ãã©ã³ã¹ããã¿ãŒãéåžžã«ç°¡åã«äœæã§ããŸãã
æãç°¡åãªéšåã¯èªæžã§ãã
ã·ãªã¢ã«ããŒããä»ããéä¿¡ãå®è£ ããã«ã¯ãåè¿°ã®QSerialPortïŒãããªã³ã¿ãŒããšåŒã°ããã€ã³ã¹ã¿ã³ã¹ïŒã䜿çšããŸããããã¯ãããŒãã§æ å ±ãåä¿¡ãããã³ã«åŒã³åºãããreadyReadïŒïŒä¿¡å·ãæã¡ãŸãã å¿ èŠãªã®ã¯ãã¯ã©ã¹ã«ã¹ããããäœæããããšã ãã§ãããã®ä¿¡å·ã衚瀺ããããåŒã³åºããŠãæ¥ç¶ããŠåŸ æ©ããŸãã äœãèªã¿ãŸããïŒ äžèšã®ããã«ãç§ãã¡ã¯äž»ã«okãšwaitã®çãã«èå³ããããŸãã ã³ãŒãã¯éåæã«å®è¡ãããããªã³ã¿ã«ã¯ãããã¡ããããããéä¿¡æã«éä¿¡ã§ããéãç¥ãããã«ãåãå ¥ããè¡æ°ãã©ããã«ä¿åããå¿ èŠããããŸãã ãããã¯å€æ°ãreadyRecieveãã«ä¿åãããŸãã
ã¹ãããïŒ
void MainWindow::readSerial() { if(printer.canReadLine()) // , { QByteArray data = printer.readLine(); // if(data.startsWith("ok")) readyRecieve++; // else if(data.startsWith("wait")) readyRecieve = 1; // , - 1 printMsg(QString(data)); // , } }
ããŠãã¬ã»ãã·ã§ã³ãæŽçããŸããã ãããŠãéä¿¡ã«ã€ããŠã¯ã©ãã§ããïŒ ããã«ãããã³ã«ã®æ¬ é¥ããããŸãã ããŒã¿ãåä¿¡ããæºåãã§ããŠããããšã瀺ãããŒããŠã§ã¢ã³ãã³ãã¯ãããŸãããã€ãŸããQSerialPortã«ã¯å¯Ÿå¿ããä¿¡å·ããããŸããã ã¿ã€ããŒã§éä¿¡ããŸãã Qtã®ã¿ã€ããŒã¯ãšãŠã€ããªãç°¡åãã€äŸ¿å©ã«åäœããŸã-QTimerã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ãäœæãããã®ã¿ã€ããŒã«ãã£ãŠå®è¡ãããã¿ã€ã ã¢ãŠãïŒïŒä¿¡å·ãã¹ãããã«æ¥ç¶ããã¿ã€ããŒïŒstart.msïŒãéå§ããŸãã åŸã§ãPCã®ããã©ãŒãã³ã¹ã«å¿ããŠãæé©ãªééã¯1ã5ããªç§ã§ããããšãããããŸããã ãšããã§ãéé0ãã¿ã€ããŒãšããŠæå®ããå ŽåãQtã«ç©ºãæéãããã°ããã«å®è¡ãããŸãã
ãŸãããŠãŒã¶ãŒããã®ã³ãã³ããŸãã¯ãã¡ã€ã«ã®ãããããéä¿¡ããããšã«ãèšåãã䟡å€ããããŸãã ãã¡ã€ã«ã®è§£æã¯ãéåžžã®ãã¡ã€ã«ã®é åãžã®èªã¿èŸŒã¿ãšãã³ã¡ã³ãããå®å šã«è¡ããã£ã«ã¿ãŒåŠçããããšã«ãªããŸãïŒããªã³ã¿ãŒã«å€§éã«éä¿¡ããã¡ã¢ãªãŒãä¹±éã«ããªãããïŒããã®éšåãçç¥ããããšã«ããŸããã ãã¡ã€ã«ã®è¡ã®é åã¯gcodeãšåŒã°ããŸãã
å®è£ ã®éä¿¡ïŒ
void MainWindow::sendNext() { if(injectingCommand && printer.isWritable() && readyRecieve > 0) // { sendLine(userCommand); // (userCommand injectingCommand ) readyRecieve--; // , injectingCommand=false; // , return; // } else if(sending && !paused && readyRecieve > 0 && !sdprinting && printer.isWritable()) //, { if(currentLine >= gcode.size()) // { sending = false; // - currentLine = 0; // ui->sendBtn->setText("Send"); // ui->pauseBtn->setDisabled("true"); // ui->filelines->setText(QString::number(gcode.size()) // + QString("/") + QString::number(currentLine) + QString(" Lines")); return; // } sendLine(gcode.at(currentLine)); // - currentLine++; // readyRecieve--; // ui->filelines->setText(QString::number(gcode.size()) // + QString("/") + QString::number(currentLine) + QString(" Lines")); ui->progressBar->setValue(((float)currentLine/gcode.size()) * 100); // } }
ããŠãããªãã¯ã·ãªã¢ã«ããŒããæ±ããŸãããïŒ ãŸã ã§ãã ãŸãããšã©ãŒããã£ããããå¿ èŠããããŸãã ãããè¡ãããã«ãä¿¡å·ãšã¹ãããã«åã³é ŒããŸããä»åã¯ãQSerialPortã€ã³ã¹ã¿ã³ã¹ããã®ãšã©ãŒä¿¡å·ïŒSerialPort :: SerialPortErrorãšã©ãŒïŒããªãã¹ã³ããŸãã
void MainWindow::serialError(QSerialPort::SerialPortError error) { if(error == QSerialPort::NoError) return; // - if(printer.isOpen()) printer.close(); // - , if(sending) paused = true; // - - ui->connectBtn->setText("Connect"); // ui->sendBtn->setDisabled(true); // ui->pauseBtn->setDisabled(true); // ui->controlBox->setDisabled(true); // ui->consoleGroup->setDisabled(true); // qDebug() << error; // QString errorMsg; // switch(error) { case QSerialPort::DeviceNotFoundError: errorMsg = "Device not found"; break; case QSerialPort::PermissionError: errorMsg = "Insufficient permissions\nAlready opened?"; break; case QSerialPort::OpenError: errorMsg = "Cant open port\nAlready opened?"; break; case QSerialPort::TimeoutError: errorMsg = "Serial connection timed out"; break; case QSerialPort::WriteError: case QSerialPort::ReadError: errorMsg = "I/O Error"; break; case QSerialPort::ResourceError: errorMsg = "Disconnected"; break; default: errorMsg = "Unknown error\nSomething went wrong"; break; } ErrorWindow errorwindow(this, errorMsg); // errorwindow.exec(); }
ããªã³ã¿ãŒã®äžæ£ç¢ºãªåŠçã¯ãæç«%% usernameïŒ ãæ··ä¹±ãããŸãã
ãã¹ããããã¹ããŒãã«ãã
ã³ãã³ãã®ãã¿ã³ãåãåºããŸã
ãã¡ã€ã«ãã·ãªã¢ã«ããŒãã«éä¿¡ãããããã³ã«ãæ£ããä¿æããæ¹æ³ãåŠã³ãŸããããããã¯å®å šãªãã¹ãã«ã¯äžååã§ãã ãã¡ã€ã«ã1è¡ãã€éä¿¡ããæ©èœã«å ããŠããŠãŒã¶ãŒãèªåã§ã³ãã³ããéä¿¡ã§ããããã«ããå¿ èŠããããŸãã äž¡æ¹ãšãæã§é§åãããã€ã³ã¿ãŒãã§ãŒã¹ã®ãã¿ã³ã«è¡šç€ºãããŸãã
ã©ã®ããŒã ã衚瀺ããå¿ èŠããããŸããïŒ ç°ãªãæ¢åã®ããã°ã©ã ã®äœè ã®æèŠã¯ç°ãªããŸãããæ倧å€ãæšæž¬ããããšããŸããã
ã¢ã€ã³ã³ã¯ãŸã ãããŸããããå°æ¥ã®ãªãªãŒã¹ã§ç¢ºå®ã«è¡šç€ºãããŸãã ãããã®ãã¿ã³ã®ã»ãšãã©ã®å®è£ ã¯éåžžã«ç°¡åã§ãã
void MainWindow::homeall() { injectCommand("G28"); }
以åã«åŠç¿ããæ¹æ³ã§ããinjectCommandã¡ãœããããã³ãŒãéä¿¡è ã®å®è£ ã«ãããŠéåžžã«ç°¡åã§ãã
void MainWindow::injectCommand(QString command) { injectingCommand = true; // userCommand = command; // }
è¿œå ããŒã¿ãååŸããŸã
RepRapã¯å³ããDIYã§ãã ãšãŠãå³ããã®ã§ãäœã§ãèµ·ãããŸãïŒ
ã»ããã¢ããäžã«åžžã«ããªã³ã¿ãæ£åžžã«åäœããããšã確èªã§ããããã§ã¯ãããŸããã éåžžã«éèŠãªå€ã®1ã€ã¯æž©åºŠã§ããããããç£èŠããããšãäžå¯æ¬ ã§ãã ããªã³ã¿ãŒã®äžéšã®ãŠãŒã¶ãŒã¯ãæäœæ å ±ã衚瀺ãããã£ã¹ãã¬ã€ãæã£ãŠããŸããããã¹ãŠã§ã¯ãããŸããã ããã«ãããªã³ã¿ããç©ççã«é¢ããããééã£ãè§åºŠã«ãªã£ãããããšããã£ã¹ãã¬ã€ãèªã¿åããªããªããŸãã ããã枩床ã衚瀺ããå¿ èŠãããçç±ã§ãããé«éã§ããã»ã©è¯ãã§ãã
枩床ã®äžã§ãèŠçŽ ã®åå¥ã®ã°ã«ãŒããå®çŸ©ããŸã
圌女ãèªèããæ¹æ³ã¯ïŒ å ç±äžãããªã³ã¿ãŒã¯ã³ãã³ãã®åãå ¥ããåæ¢ãã OKãŸãã¯åŸ æ©ã®ä»£ããã«æž©åºŠã®éä¿¡ãéå§ããŸãã 枩床ããŒã¯æ¬¡ã®ããã«ãªããŸãã
TïŒ196.94 / 210 BïŒ23.19 / 0 B @ïŒ0 @ïŒ4
人éã«ã¯èªã¿ããããã解æã«ã¯ããŸã䟿å©ã§ã¯ãªãã æåã®ããŒãžã§ã³ã§ã¯ãæ å ±ãåä¿¡ããã¹ãããã§ãã®è¡ãçŽæ¥è§£æããŸãããããã¹ãã§ã¯ããã®ã¹ãããã§è¡ãçŽæ¥è§£æãããšããã°ã©ã ãéåžžã«é ããªãããšã瀺ãããŸããã RepRaptorãæžãããäž»ãªçç±ã®1ã€ã¯é床ã§ãããããæè¿ãŸã§ã¹ã¬ããã®æäœãé¿ããããšããŸããã ãã«ãã¹ã¬ããã¯ããã«ãã³ã¢ã·ã¹ãã ã§ã®ãœãããŠã§ã¢ã®äœæ¥ãå®å šã«é«éåããŸãããéã§ã¯ãã¹ãŠããã©è²ã§ã¯ãããŸããã§ããã ãã ããéžæã®äœå°ã¯ãããŸããã§ãããåæãŸãã¯æ¥ç¶èªäœãå¥ã®ã¹ã¬ããã«è»¢éããå¿ èŠããããŸããã 劥åããããšã«æ±ºããŸãã-åæãå¥ã®ã¹ããªãŒã ã«è»¢éãããŠãŒã¶ãŒã枩床ãã§ãã¯ãç¡å¹ã«ã§ããããã«ããŸãã
Qtã§ã®ãã«ãã¹ã¬ããã®å®è£ æ¹æ³ã¯ïŒ ãšãŠãå¿«é©ã§ãã å¥ã®ã¹ã¬ãããäœæããæ¹æ³ã¯ããã€ããããŸãã æ¬æ Œçãªæ¹æ³ã¯QThreadã䜿çšããŠã¹ã¬ãããäœæããããšã§ãããåçŽãªè¡è§£æã«æ¬æ Œçãªã¹ã¬ããã¯å¿ èŠãªããããå¥ã®æ¹æ³ã䜿çšããŸãã解æé¢æ°ãåŒæ°ãšãšãã«QFutureãªããžã§ã¯ãã«æž¡ããç£èŠããŸãã ããã¯æ¬¡ã®ããã«è¡ãããŸã-æåã«ãQFutureãç£èŠãããã®ã¹ããŒã¿ã¹ãéç¥ããã¯ã©ã¹ã§ããQFutureWatcherã®ã€ã³ã¹ã¿ã³ã¹ãäœæããå¿ èŠããããŸãã 次ã«ã解æé¢æ°ãèšè¿°ããå¿ èŠããããŸãã é¢æ°ã¯1ã€ã®å€æ°ã®ã¿ãè¿ãããšãã§ããããã枩床ã転éããããã®ç¹å¥ãªã¿ã€ããäœæããããšã«ããŸããã
typedef struct { double e, b; } TemperatureReadings;
ãããŠè§£æé¢æ°ïŒ
TemperatureReadings MainWindow::parseStatus(QByteArray data) { QString extmp = ""; // QString btmp = ""; // for(int i = 2; data.at(i) != '/'; i++) // { extmp+=data.at(i); } for(int i = data.indexOf("B:")+2; data.at(i) != '/'; i++) // { btmp+=data.at(i); } TemperatureReadings t; te = extmp.toDouble(); // tb = btmp.toDouble(); return t; // }
ä»ã§ã¯ããã®æ©èœãæ©äŒã«ã¹ããªãŒã ã«äžããã ãã§ãïŒèªååä¿¡æ©èœã«è¿œå ã®ãã§ãã¯ãæ¿å ¥ããŸãïŒïŒ
//.... else if(checkingTemperature && data.startsWith("T:")) // , { QFuture<TemperatureReadings> parseThread = QtConcurrent::run(this, &MainWindow::parseStatus, data); // QFuture (QtConcurrent::run QFuture parseStatus) statusWatcher.setFuture(parseThread); // QFuture ui->tempLine->setText(data); // } //...
ä¿¡å·ãæ¥ç¶ããããã®ã¹ããããäœæããQFutureWatcherããé¢æ°ã®çµæãéä¿¡ããã ãã§ãã
void MainWindow::updateStatus() { TemperatureReadings r = statusWatcher.future().result(); // ui->extruderlcd->display(re); // ui->bedlcd->display(rb); sinceLastTemp.restart(); // }
ããã§ãããªã³ã¿ãã枩床ãéç¥ããããã³ã«ããã®è¡ã解æãããã€ã³ã¿ãŒãã§ã€ã¹ã«ãããã«è¡šç€ºãããŸãã
åé¡ã¯ãããªã³ã¿ãŒèªäœãå ç±äžã«ã®ã¿éä¿¡ããããšã§ãããM105ã®æž©åºŠã確èªããã³ãã³ããéä¿¡ããããšã«ããããã€ã§ãéä¿¡ã§ããããã«äŸé Œããããšãã§ããŸãã ããã€ãã®æ¡ä»¶ãæºããããããã¿ã€ããŒã§éä¿¡ããŸãã åãšåãããã«ãéä¿¡æ©èœçšã®æ°ããã¿ã€ããŒãšããã®ä¿¡å·ã«æ¥ç¶ããããã®æ°ããã¹ããããäœæããŸãã ä»åã¯ãã¿ã€ããŒããã倧ããªå€ãããšãã°1500msã«èšå®ããŸãã
void MainWindow::checkStatus() { if(checkingTemperature && // .... (sinceLastTemp.elapsed() > statusTimer.interval()) // , && statusWatcher.isFinished()) injectCommand("M105"); // , M105 }
誰ãããããã®ãã§ãã¯ã¯äžèŠã§ãããšèšããããããŸããããAsus EEEPC 900AXã§ããªã³ã¿ãŒãå¶åŸ¡ããåæã«ãããèªã¿ããå Žåãããã¯å¿ èŠã§ãã
SDã«ãŒãããã®å°å·
3Dããªã³ã¿ãŒçšã®å€ãã®å žåçãªããŒãã«ã¯ãSDã«ãŒãã¹ããããçµã¿èŸŒãŸããŠãããããã®ãããªã¹ããããæ¥ç¶ããæ¹æ³ããããŸãã ãã®å°å·æ¹æ³ã¯ããã€ã§ãããªã³ã¿ãŒããåæããŠé¢ããããšãã§ããããã奜ãŸããæ¹æ³ã§ãããã ããç¹ã«å€ãã®çŽ°ããéšåãå°å·ããå Žåã¯ãæ¯åSDã«ãŒããåŒãåºãã®ãé¢åã§ãã ãã¡ãããã·ãªã¢ã«ããŒãçµç±ã§ãã¡ã€ã«ã転éããããšãã§ããŸããããã®æ¹æ³ã§ãã¡ã€ã«ã転éããããšã¯ãããèªäœãå°å·ãããããã»ãšãã©æéãããããŸããã
ãããã®å Žåã§ãããã¹ãã¯SDã«ãŒããæäœã§ããå¿ èŠããããŸããã€ãŸãã次ã®ããšãæå³ããŸãã
- ãã¡ã€ã«ãªã¹ããååŸãã
- ãã¡ã€ã«ãéžæ
- å°å·ãã¡ã€ã«
- å°å·ãäžæåæ¢ãã
- é²æãå ±åãã
ãããŠãããã¯ããå€ãã®è§£æãæå³ããŸãïŒ ããããä»åã¯ããã¡ã€ã«ã®ãªã¹ããããŒãªã³ã°ãããšããããã©ãŒãã³ã¹ã«ã€ããŠå¿é ããããšã¯ã§ããŸãã-ãã®æç¹ã§ã¯éèŠã§ã¯ãããŸããã ãã¡ã€ã«ã®ãªã¹ãã衚瀺ããã«ã¯ããã€ã¢ãã°ãå¿ èŠã§ãã ãã¡ã€ã«ãå«ãè¡ã®é åããã€ã¢ãã°ã«è»¢éãã1ã€ã®ãã¡ã€ã«ãè¿ããŸããåæã«ãããã°ã©ã ãSDã§å°å·ã¢ãŒãã§ããããšãããã°ã©ã ã«éç¥ããŸãã
SDäžã®ãã¡ã€ã«ã®ãªã¹ããéå§ãããã¹ãã«è¡ãæ¥ããã³ã«ããã¡ã€ã«ã®ãªã¹ããå«ããã€ã¢ãã°ãéããŸãã ãããè¡ãã«ã¯ãåä¿¡æ©ãå床å€æŽããŸãã
//... if(readingFiles) // { if(!data.contains("End file list")) sdFiles.append(data); // - else { readingFiles = false; // emit sdReady(); // } } //... else if(data.startsWith("Done")) sdprinting = false; // Done - SD else if(data.startsWith("SD printing byte") && sdWatcher.isFinished()) // SD { QFuture<double> parseSDThread = QtConcurrent::run(this, &MainWindow::parseSDStatus, data); // sdWatcher.setFuture(parseSDThread); // } else if(data.contains("Begin file list")) // SD { sdFiles.clear(); readingFiles = true; // , } //...
èªã¿åãã¡ãœããã¯åè¡ã«å¯ŸããŠåŒã³åºãããããããã©ã°ãå¿ èŠã§ãã
ãŸãããã€ã¢ãã°ãéãããã«ãã·ã°ãã«ãéä¿¡ããŸãã 圌èªèº«ã«ã ã¯ããåããªããžã§ã¯ãã®ã¹ãããã«ä¿¡å·ãæ¥ç¶ããããšãã§ããŸãã
ãã®ä¿¡å·ã«æ¥ç¶ããã¹ãããïŒ
void MainWindow::initSDprinting() { SDWindow sdwindow(sdFiles, this); connect(&sdwindow, SIGNAL(fileSelected(QString)), this, SLOT(selectSDfile(QString))); sdwindow.exec(); }
ãã®åŸãã€ã³ã¿ãŒãã§ã€ã¹ãå°å·ã¢ãŒãã«ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ããªãã·ã§ã³ã®sdprintingãã©ã°ãå°å ¥ããŸããã SDã«ãŒãããã®å°å·ã¹ããŒã¿ã¹ã¯ã枩床ãšåæ§ã®æ¹æ³ã§ãã§ãã¯ãããŸãã
ãœãã-倧è¡ãž
ç§ãGitHubãã©ãã»ã©æããŠããŠãã誰ããèªåã§ãœãããŠã§ã¢ãæ§ç¯ããããšã奜ãããã§ã¯ãããŸããã ã¯ãã¹ãã©ãããã©ãŒã ã«ãããããããQtã¯ãã¬ãŒã ã¯ãŒã¯ã§ãããã¯ãã¹ã³ã³ãã€ã«ç°å¢ã§ã¯ãããŸããã ã€ãŸããLinux-amd64ãã©ãããã©ãŒã ã®ãã€ããªã«å ããŠãLinux-i386ãWindows 32ãããã³OSX 64ã®ãã€ããªãå¿ èŠã§ããæåã®2ã€ã¯åçŽã§ã-å¿ èŠãªã»ãããQtCreatorã«è¿œå ããã ãã§ãã Windows 32ãšOSX 64ã¯ã©ãã§ããïŒ åŸè ã§ã¯-äœããããŸããã è©ŠããŸããããæãæŽããŸãã OSXã§äœãããã«ãããå¯äžã®æ¹æ³ã¯ãOSXã§ãããè¡ãããšã§ãã æ®å¿µãªãããããã¯æ³çã«äžå¯èœã§ãã
Debianãšãã®ããã±ãŒãž
ç§ã¯ãéçºäžã®ãæ°ã«å ¥ãã®Linux Mintçšã®ããã±ãŒãžãæ§ç¯ãããã£ãã®ã§ãã æåã¯PPAçšã®ããã±ãŒãžãæ§ç¯ãããã£ãã®ã§ãããæçµçã«ã¯Qtéçã©ã€ãã©ãªã§åéããå¿ èŠããããšããçµè«ã«éããŸããããããã£ãŠãæåã«ããã±ãŒãžãåéããå¿ èŠããããŸããã ãªãéçãªã³ã¯ãªã®ãïŒ ãã¹ãŠãéåžžã«åçŽã§ã-Mintã®ããŒã¹ãšãªã£ãŠããUbuntu 14.04ã§ãããœãŒã¹ã§ã¯Qt 5.2.1ã®ã¿ã䜿çšå¯èœã§ãã ç°ãªãã·ã¹ãã ã§ã®æåã®2ã€ã®ãªãªãŒã¹ã®ãã¹ãäžã«ãæ°ããããŒãžã§ã³ã§ä¿®æ£ãããQSerialPortã®ãã°ãä¿®æ£ãããããããã¹ãŠãææ°ããŒãžã§ã³ã§åºè·ããããšã決å®ãããŸããã ããã«ãQt wikiã«ã¯ãéçã«ãªã³ã¯ãããã©ã€ãã©ãªãå€å°éãåäœãããšæžãããŠããŸãã
æäœæ¥ã§ããã±ãŒãžããã«ãããã®ã¯éåžžã«ç°¡åã§ããã€ã³ã¹ããŒã«ãããã¹ãŠã®ãã¡ã€ã«ãå«ãDebianãã¡ã€ã«ã·ã¹ãã ã®ãã£ã¬ã¯ããªããªãŒãå«ãŸããŠããå¿ èŠããããŸãã å®å ã·ã¹ãã ã§ã¡ãã¥ãŒé ç®ãååŸããããã«.desktopãã¡ã€ã«ãäœæããã®ã§ãå¿ èŠãªããã±ãŒãžã®ããŒãžã§ã³ããã«ãããããã®å°ããªbashã¹ã¯ãªãããäœæããŸããã
#!/bin/bashcd # $1 - mkdir repraptor-$1-1-i386 mkdir repraptor-$1-1-amd64 mkdir repraptor-$1-1-i386/DEBIAN/ mkdir repraptor-$1-1-i386/usr/ mkdir repraptor-$1-1-i386/usr/local/ mkdir repraptor-$1-1-i386/usr/local/bin mkdir repraptor-$1-1-i386/usr/local/share mkdir repraptor-$1-1-amd64/DEBIAN/ mkdir repraptor-$1-1-amd64/usr/ mkdir repraptor-$1-1-amd64/usr/local/ mkdir repraptor-$1-1-amd64/usr/local/bin cp ../RepRaptor-linux32/RepRaptor repraptor-$1-1-i386/usr/local/bin/repraptor cp ../RepRaptor-linux64/RepRaptor repraptor-$1-1-amd64/usr/local/bin/repraptor cp share repraptor-$1-1-i386/usr/local/ -r cp share repraptor-$1-1-amd64/usr/local/ -r echo "Package: repraptor Version: $1-1 Section: base Priority: optional Architecture: i386 Maintainer: [Hello Habr!] Description: RepRaptor A Qt RepRap gcode sender/host controller" > repraptor-$1-1-i386/DEBIAN/control echo "Package: repraptor Version: $1-1 Section: base Priority: optional Architecture: amd64 Maintainer: [Hello Habr!] Description: RepRaptor A Qt RepRap gcode sender/host controller" > repraptor-$1-1-amd64/DEBIAN/control dpkg-deb --build repraptor-$1-1-i386 dpkg-deb --build repraptor-$1-1-amd64
ãã£ã¬ã¯ããªããªãŒãäœæããã¢ã€ã³ã³ãš.desktopãã¡ã€ã«ãã³ããŒããŠãããããã±ãŒãžãããŒãžã£ãŒã®ããã±ãŒãžã®èª¬æãçæããå¿ èŠãªããŒãžã§ã³ãæ¿å ¥ããã ãã§ãã
Windowsããã³MXE
OSã®ããã±ãŒãžãåéããããšãšãä»ã®äººã®ããã±ãŒãžãåéããããšã®1ã€ã§ãã ããã§ã¯ãããŒã«ããã-ã¢ã»ã³ããªçšã®ããŒã«ã»ãããå¿ èŠã§ãã 幞ããªããšã«ãWindowsã«ã¯åªããMinGWããããLinuxã«ã¯åçã®åªããMXEããããŸããããã¯ãç¡æã®ã©ã€ãã©ãªã䜿çšããã¯ãã¹ã³ã³ãã€ã«çšã®ç°å¢ãããŒãžã£ãŒã§ãã
ã€ã³ã¹ããŒã«ã¯ãšãŠã€ããªãç°¡åã§ã-MXEã®ã¯ããŒã³ãäœæããå¿ èŠãªã©ã€ãã©ãªãæå®ããŸãã
git clone https://github.com/mxe/mxe.git cd mxe make qtbase qtserialport
ãã®åŸãããªãã¯å®å šã«ã³ãŒããŒã飲ã¿ã«è¡ãããšãã§ããŸã-ããããã¹ãŠãçµã¿ç«ãŠãã«ã¯ããªãã®æéãããããŸãã
ã¢ã»ã³ããªãå®äºããããWindowsã§ãããžã§ã¯ããèªåçã«ãã«ãããã¹ã¯ãªãããäœæã§ããŸãã
#!/bin/bash # MXE PATH export PATH=/home/neothefox/src/mxe/usr/bin:$PATH # rm -rf RepRaptor-win32 # git clone https://github.com/NeoTheFox/RepRaptor RepRaptor-win32 cd RepRaptor-win32 # Makefile QtCreator /home/neothefox/src/mxe/usr/bin/i686-w64-mingw32.static-qmake-qt5 RepRaptor.pro make # ZIP cp LICENCE release/ cd release zip RepRaptor-$1-win32.zip RepRaptor.exe LICENCE # mv RepRaptor-$1-win32.zip ../../RepRaptor-$1-win32.zip
ã·ã³ãã«ã§éœæ°ãªã Wineã§ããã©ãŒãã³ã¹ãç°¡åã«ç¢ºèªã§ããŸãã
çµè«
ãããå§ãããšããç§ã¯åçŽãªGã³ãŒããã¡ã€ã«éä¿¡ãæžãããšãæãã§ããŸããããããã¯ãã以äžäœãããŸããããå€æ¹ã«ããã管çããäºå®ã§ããã ããããããããããšã§ããããããžã§ã¯ãã¯åœåã®èšç»ãè¶ ããŠãããçŸåšã¯ããã«å€ãã®ãã®ã§ãã ãŸã ããããšããããããããŸã-å°ãªããšãåãEEPROMã°ã©ãã£ãã¯ãšãã£ã¿ãŒïŒããã¯éåžžã«äžè¶³ããŠããŸãïŒãšããã§ãã¯ãµã ã®ãµããŒãã§ãã
ãã ãããã§ã«RepRaptorã䜿çšãããšãASUS EEEPCãããªã³ã¿ãŒã®å®å®ãããã¹ããšããŠå®å šã«äœ¿çšã§ããŸããããã¯ãä»ã®ãã¹ãã§ã¯å®çŸã§ããŸããã§ããã ããŠãç§ã®Qtã®ç¥èã¯ééããªãæ¹åãããŸããããäŸç¶ãšããŠæé©åã®äœå°ããããŸãã
ãã®èšäºã¯ãŸããç§èªèº«ãæ¯æ¥äœ¿çšããŠããæåã®å®å®ããŒãžã§ã³ã§ãã0.2ã®ãªãªãŒã¹ã«ã€ããŠã説æããŠããŸãã
ãæž èŽããããšãããããŸããïŒ ç§ã®çµéšãã圹ã«ç«ãŠã°å¹žãã§ãã
æåŸã«-ãã¹ãäžã«å°å·ããããªããžã§ã¯ãã®è»éã¯æ¬¡ã®ãšããã§ãã
åç §è³æ
æåã®å®å®ããŒãžã§ã³
Reprap wiki
Github