{"id":24603601,"url":"https://github.com/digitalartifex/qklipper","last_synced_at":"2025-05-01T13:41:37.756Z","repository":{"id":255208725,"uuid":"848871380","full_name":"DigitalArtifex/QKlipper","owner":"DigitalArtifex","description":"Qt based Klipper/Moonraker library","archived":false,"fork":false,"pushed_at":"2025-03-30T00:38:39.000Z","size":15290,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T01:32:02.764Z","etag":null,"topics":["3d-printing","klipper","library","qt6"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DigitalArtifex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T14:58:24.000Z","updated_at":"2025-03-30T00:38:43.000Z","dependencies_parsed_at":"2024-08-28T16:34:17.519Z","dependency_job_id":"32ffde62-3cff-471c-a5b1-0ee4b5f9da32","html_url":"https://github.com/DigitalArtifex/QKlipper","commit_stats":null,"previous_names":["digitalartifex/qklipper"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalArtifex%2FQKlipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalArtifex%2FQKlipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalArtifex%2FQKlipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalArtifex%2FQKlipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DigitalArtifex","download_url":"https://codeload.github.com/DigitalArtifex/QKlipper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251882740,"owners_count":21659322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-printing","klipper","library","qt6"],"created_at":"2025-01-24T15:14:46.699Z","updated_at":"2025-05-01T13:41:37.744Z","avatar_url":"https://github.com/DigitalArtifex.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![alt text](https://github.com/DigitalArtifex/QKlipper/blob/main/qklipper_small.jpg)\n# QKlipper\nQt based Klipper/Moonraker library (ALPHA - convenience methods still being ported over the next couple of days as well as QML compatability) \n\n\n## Setup\n\n```\n    git clone https://github.com/DigitalArtifex/QKlipper.git\n    cd QKlipper\n```\n\nYou can configure and build the project by either cloning and opening the QKlipper repo in QtCreator, or use the `qt-cmake` tool provided by the target kit. In this example we are targeting the Qt 6.8.1 kit for GCC64, which has been installed to `/opt/Qt`. To keep the source directory clean, we first create our build directory and execute `qt-cmake` from there.\n\n```\n    mkdir -p build/release\n    cd build/release\n    /opt/Qt/6.8.1/gcc_64/bin/qt-cmake -S $PWD/../../ -B $PWD\n    cmake --build $PWD\n    sudo cmake --install $PWD\n```\n\n## Usage\n\n### Qt Project File\n```\n    LIBS += -L$$[QT_HOST_LIBS] -lQt$$[QT_MAJOR_VERSION]\n```\n\n### CMake Project File\n```\n    find_package(QKlipper 1.0.1 REQUIRED)\n\n    target_link_libraries(MyProject\n        PRIVATE\n            ${QKlipper_LIBRARIES}\n    )\n\n```\n\n### Local connections\n```\n    //Creating a local instance\n    QKlipperInstance *instance = new QKlipperInstance();\n    instance-\u003esetName(\"QKlipper Test\");\n    \n    //address and port for non-rpc calls\n    instance-\u003esetPort(7125);\n    instance-\u003esetAddress(\"http://localhost\");\n    \n    //instance location is required for local connections\n    instance-\u003esetInstanceLocation(\"/home/parametheus/printer_data\");\n    \n    instance-\u003econnect();\n```\nLocal connections require `setInstanceLoction` to be called with the fully qualified path of the klipper installation.\n\n### Remote connections\n```\n    //Creating a remote instance\n    QKlipperInstance *instance = new QKlipperInstance();\n    instance-\u003esetName(\"QKlipper Test\");\n    \n    //address and port for klipper instance\n    instance-\u003esetPort(7125);\n    instance-\u003esetAddress(\"http://artifex\"); //it is best to use the hostname, IP or full domain name. Avoid using .local\n    \n    instance-\u003econnect();\n```\n\nOnce `QKlipperInstance-\u003econnect()` has been called the QKlipperConole will attempt to connect to the sockets and begin the startup sequence.\n\n\n## Usage\nIn order to interface with the Klipper instance we need to make sure the console has connected and syncronized. The easiest way to do this is to connect to\nthe **QKlipperInstance::connected()** signal. If you want, you can instead connect to the **QKlipperConsole::connectionStateChanged()** to react to the individual\nstates of the connection process.\n```\nclass MyClass : QObject\n{\n    Q_OBJECT\n    QKlipperPrinter *printer = nullptr;\n    QKlipperInstance *instance = nullptr;\n    \n    public:\n        MyClass(QObject *parent = nullptr) : QObject{parent}\n        {\n            //Creating a local instance\n            instance = new QKlipperInstance();\n            instance-\u003esetName(\"QKlipper Test\");\n            \n            //address and port for non-rpc calls\n            instance-\u003esetPort(7125);\n            instance-\u003esetAddress(\"localhost\"); //do not include http\n            \n            //instance location is required for local connections\n            instance-\u003esetInstanceLocation(\"/home/parametheus/printer_data\");\n            \n            //connect to the signal\n            connect(instance, SIGNAL(connected), this, SLOT(onInstanceConnected()));\n            \n            //set the printer object\n            printer = instance-\u003eprinter();\n            \n            //connect to Klipper\n            instance-\u003econnect();\n        }\n    \n    protected slots:\n        void onInstanceConnected()\n        {\n            //console is ready\n            printer-\u003etoolhead()-\u003ehome(); //homes the toolhead\n            printer-\u003etoolhead()-\u003esetPosition(100, 50, 50); //sets absolute position\n            printer-\u003ebed()-\u003esetTargetTemperature(60); //sets the target temp (C)\n        }\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalartifex%2Fqklipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalartifex%2Fqklipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalartifex%2Fqklipper/lists"}