mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-29 19:53:44 -06:00
Firmware updater: Make the GUI less scary
This commit is contained in:
parent
c5f1acfbfb
commit
a54672fb54
5 changed files with 211 additions and 68 deletions
|
|
@ -8,12 +8,34 @@
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
namespace AvrDude {
|
||||
class AvrDude
|
||||
{
|
||||
public:
|
||||
typedef std::function<void(const char * /* msg */, unsigned /* size */)> MessageFn;
|
||||
typedef std::function<void(const char * /* task */, unsigned /* progress */)> ProgressFn;
|
||||
|
||||
AvrDude();
|
||||
AvrDude(AvrDude &&) = delete;
|
||||
AvrDude(const AvrDude &) = delete;
|
||||
AvrDude &operator=(AvrDude &&) = delete;
|
||||
AvrDude &operator=(const AvrDude &) = delete;
|
||||
~AvrDude();
|
||||
|
||||
// Set location of avrdude's main configuration file
|
||||
AvrDude& sys_config(std::string sys_config);
|
||||
// Set message output callback
|
||||
AvrDude& on_message(MessageFn fn);
|
||||
// Set progress report callback
|
||||
// Progress is reported per each task (reading / writing), progress is reported in percents.
|
||||
AvrDude& on_progress(MessageFn fn);
|
||||
|
||||
int run(std::vector<std::string> args);
|
||||
private:
|
||||
std::string m_sys_config;
|
||||
MessageFn m_message_fn;
|
||||
ProgressFn m_progress_fn;
|
||||
};
|
||||
|
||||
int main(std::vector<std::string> args, std::string sys_config, MessageFn message_fn);
|
||||
int main(std::vector<std::string> args, std::string sys_config, std::ostream &os);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue