├── .github
└── workflows
│ ├── build_tests.yml
│ └── release.yml
├── .gitignore
├── 3rdparty
├── 3rdparty.pro
├── basic
│ ├── basic.pro
│ ├── basic_interpreter.cpp
│ └── basic_interpreter.h
├── include
│ ├── QtLockedFile
│ └── QtSingleApplication
├── kdiff3
│ ├── common.cpp
│ ├── common.h
│ ├── compatibility.h
│ ├── diff.cpp
│ ├── diff.h
│ ├── difftextwindow.cpp
│ ├── difftextwindow.h
│ ├── fileaccess.cpp
│ ├── fileaccess.h
│ ├── gnudiff_analyze.cpp
│ ├── gnudiff_diff.h
│ ├── gnudiff_io.cpp
│ ├── gnudiff_system.h
│ ├── gnudiff_xmalloc.cpp
│ ├── kdiff3.cpp
│ ├── kdiff3.h
│ ├── kdiff3.pro
│ ├── merger.cpp
│ ├── merger.h
│ ├── mergeresultwindow.cpp
│ ├── mergeresultwindow.h
│ ├── optiondialog.cpp
│ ├── optiondialog.h
│ └── pdiff.cpp
└── qtsingleapplication
│ ├── qtlocalpeer.cpp
│ ├── qtlocalpeer.h
│ ├── qtlockedfile.cpp
│ ├── qtlockedfile.h
│ ├── qtlockedfile_unix.cpp
│ ├── qtlockedfile_win.cpp
│ ├── qtsingleapplication.cpp
│ ├── qtsingleapplication.h
│ ├── qtsingleapplication.pri
│ ├── qtsingleapplication.pro
│ ├── qtsinglecoreapplication.cpp
│ ├── qtsinglecoreapplication.h
│ └── qtsinglecoreapplication.pri
├── COPYING
├── COPYING.LESSER
├── Doxyfile
├── INSTALL.md
├── NEWS.md
├── README.md
├── addons
├── addons.pro
├── include
│ └── addons-actions.h
└── src
│ ├── addons-actions.cpp
│ ├── addons-context.cpp
│ ├── addons-context.h
│ ├── bhc
│ ├── addons-bhc.cpp
│ ├── addons-bhc.h
│ ├── bhc.pri
│ ├── bhcdialog.cpp
│ ├── bhcdialog.h
│ ├── bhcdialog.ui
│ ├── bhcdraw.cpp
│ ├── bhcdraw.h
│ ├── bhcoptions.cpp
│ ├── bhcoptions.h
│ ├── bhctab.cpp
│ ├── bhctab.h
│ ├── bhctab.ui
│ ├── bhctaboptions.cpp
│ └── bhctaboptions.h
│ ├── blockskip
│ ├── blockskip.pri
│ ├── utils-blockskip.cpp
│ └── utils-blockskip.h
│ ├── chamfer
│ ├── addons-chamfer.cpp
│ ├── addons-chamfer.h
│ ├── chamfer.pri
│ ├── chamferdialog.cpp
│ ├── chamferdialog.h
│ ├── chamferdialog.ui
│ ├── chamferoptions.cpp
│ └── chamferoptions.h
│ ├── cleanup
│ ├── addons-cleanup.cpp
│ ├── addons-cleanup.h
│ ├── cleanup.pri
│ ├── cleanupdialog.cpp
│ ├── cleanupdialog.h
│ ├── cleanupdialog.ui
│ ├── cleanupoptions.cpp
│ ├── cleanupoptions.h
│ ├── utils-removebyregex.cpp
│ └── utils-removebyregex.h
│ ├── comment
│ ├── comment.pri
│ ├── utils-comment.cpp
│ └── utils-comment.h
│ ├── compilemacro
│ ├── compilemacro.pri
│ ├── utils-compilemacro.cpp
│ └── utils-compilemacro.h
│ ├── dot
│ ├── addons-dot.cpp
│ ├── addons-dot.h
│ ├── dot.pri
│ ├── dotdialog.cpp
│ ├── dotdialog.h
│ ├── dotdialog.ui
│ ├── dotoptions.cpp
│ ├── dotoptions.h
│ ├── utils-insertdot.cpp
│ └── utils-insertdot.h
│ ├── emptylines
│ ├── emptylines.pri
│ ├── utils-emptylines.cpp
│ └── utils-emptylines.h
│ ├── feeds
│ ├── addons-feeds.cpp
│ ├── addons-feeds.h
│ ├── feeds.pri
│ ├── feedsdialog.cpp
│ ├── feedsdialog.h
│ ├── feedsdialog.ui
│ ├── feedsoptions.cpp
│ └── feedsoptions.h
│ ├── i2m
│ ├── addons-i2m.cpp
│ ├── addons-i2m.h
│ ├── i2m.pri
│ ├── i2mdialog.cpp
│ ├── i2mdialog.h
│ ├── i2mdialog.ui
│ ├── i2moptions.cpp
│ └── i2moptions.h
│ ├── i2mprog
│ ├── addons-i2mprog.cpp
│ ├── addons-i2mprog.h
│ ├── i2mprog.pri
│ ├── i2mprogdialog.cpp
│ ├── i2mprogdialog.h
│ ├── i2mprogdialog.ui
│ ├── i2mprogoptions.cpp
│ ├── i2mprogoptions.h
│ ├── utils-i2mprog.cpp
│ └── utils-i2mprog.h
│ ├── renumber
│ ├── addons-renumber.cpp
│ ├── addons-renumber.h
│ ├── renumber.pri
│ ├── renumberdialog.cpp
│ ├── renumberdialog.h
│ ├── renumberdialog.ui
│ ├── renumberoptions.cpp
│ ├── renumberoptions.h
│ ├── utils-renumber.cpp
│ └── utils-renumber.h
│ ├── spaces
│ ├── spaces.pri
│ ├── utils-spaces.cpp
│ └── utils-spaces.h
│ ├── swapaxes
│ ├── addons-swapaxes.cpp
│ ├── addons-swapaxes.h
│ ├── swapaxes.pri
│ ├── swapaxesdialog.cpp
│ ├── swapaxesdialog.h
│ ├── swapaxesdialog.ui
│ ├── swapaxesoptions.cpp
│ ├── swapaxesoptions.h
│ ├── utils-swapaxes.cpp
│ └── utils-swapaxes.h
│ └── triangle
│ ├── addons-triangle.cpp
│ ├── addons-triangle.h
│ ├── triangle.pri
│ ├── triangledialog.cpp
│ ├── triangledialog.h
│ ├── triangledialog.ui
│ ├── triangleoptions.cpp
│ └── triangleoptions.h
├── common.pri
├── doc
├── SerialTransmission_Help.html
└── SerialTransmission_Help.odt
├── examples
├── 0100.nc
├── FANUC0M.nc
├── FANUC0T.nc
├── FLANGE.nc
├── HAAS.nc
├── HK.nc
├── OSP5020M.nc
├── OSP7000L.nc
├── PHILIPS.nc
├── SINUMERIK840D.nc
├── SINUMERIK850.nc
├── TOKARKA.NC
├── cnc_tips.txt
└── macro7.nc
├── gcodefileserver
├── filechecker.cpp
├── filechecker.h
├── filechecker.ui
├── gcodefileserver.cpp
├── gcodefileserver.h
├── gcodefileserver.pro
├── gcodefileserver.ui
├── images
│ ├── edytornc.ico
│ └── edytornc48.ico
└── main.cpp
├── gcodeshared
├── application.qrc
├── gcodeshared.pro
├── images
│ ├── add.png
│ ├── application-x-g-code.png
│ ├── arrow-down.png
│ ├── arrow-left.png
│ ├── arrow-right-double.png
│ ├── arrow-right.png
│ ├── arrow-up.png
│ ├── attach.png
│ ├── bhc.png
│ ├── blockskip+.png
│ ├── blockskip-.png
│ ├── blockskip.png
│ ├── blockskipr.png
│ ├── browse.png
│ ├── calc.png
│ ├── cancel.png
│ ├── cascade.png
│ ├── chamfer.png
│ ├── chamfer_big.png
│ ├── cleanup.png
│ ├── clipboard.png
│ ├── close_small.png
│ ├── compfile.png
│ ├── configure.png
│ ├── connect_creating.png
│ ├── connect_established.png
│ ├── connect_no.png
│ ├── copy.png
│ ├── deattach.png
│ ├── default.png
│ ├── diff.png
│ ├── diff_editor.png
│ ├── diffl.png
│ ├── diffr.png
│ ├── document-open-recent.png
│ ├── document-print-preview.png
│ ├── document-print.png
│ ├── dots.png
│ ├── edit-find.png
│ ├── edit-select-all.png
│ ├── editcopy.png
│ ├── editcut.png
│ ├── editdelete.png
│ ├── editpaste.png
│ ├── edytornc.png
│ ├── edytornc48.png
│ ├── exit.png
│ ├── fileclose.png
│ ├── fileclose_small.png
│ ├── filefind.png
│ ├── filenew.png
│ ├── fileopen.png
│ ├── filesave.png
│ ├── filesaveall.png
│ ├── filesaveas.png
│ ├── find.png
│ ├── findinfiles.png
│ ├── findnext.png
│ ├── folder.png
│ ├── funct.png
│ ├── go-next.png
│ ├── go-previous.png
│ ├── hide.png
│ ├── i2m.png
│ ├── i2mprog.png
│ ├── inlinecalc.png
│ ├── insertemptylines.png
│ ├── insertspc.png
│ ├── led.png
│ ├── list-remove.png
│ ├── lock.png
│ ├── ncfile.png
│ ├── new.png
│ ├── ok.png
│ ├── open.png
│ ├── paracomment.png
│ ├── project_add.png
│ ├── project_new.png
│ ├── project_open.png
│ ├── project_remove.png
│ ├── project_save.png
│ ├── project_save_as.png
│ ├── receive.png
│ ├── redo.png
│ ├── removeemptylines.png
│ ├── removespc.png
│ ├── renumber.png
│ ├── replace.png
│ ├── reset.png
│ ├── semicomment.png
│ ├── send.png
│ ├── serial.png
│ ├── serialconfig.png
│ ├── serialtest.png
│ ├── show_side_panel.png
│ ├── split_prog.png
│ ├── spserver.png
│ ├── start.png
│ ├── stop.png
│ ├── swapaxes.png
│ ├── tile_h.png
│ ├── tile_v.png
│ ├── triangles.png
│ ├── trig.png
│ ├── trig1.png
│ ├── txtfile.png
│ ├── undo.png
│ ├── unlock.png
│ ├── vcf.png
│ ├── window-close.png
│ ├── zoom-in.png
│ └── zoom-out.png
├── include
│ ├── ui
│ │ └── longjobhelper.h
│ ├── utils
│ │ ├── configdialog.h
│ │ ├── configpage.h
│ │ ├── gcode-converter.h
│ │ ├── guessfilename.h
│ │ ├── medium.h
│ │ └── splitfile.h
│ └── version.h
├── serialportconfigdialog.cpp
├── serialportconfigdialog.h
├── serialportconfigdialog.ui
├── serialportsettings.h
├── serialporttestdialog.cpp
├── serialporttestdialog.h
├── serialporttestdialog.ui
├── serialtransmissiondialog.cpp
├── serialtransmissiondialog.h
├── serialtransmissiondialog.ui
├── ui
│ └── longjobhelper.cpp
└── utils
│ ├── configdialog.cpp
│ ├── configdialog.ui
│ ├── configpage.cpp
│ ├── filepatterns.h
│ ├── gcode-converter.cpp
│ ├── guessfilename.cpp
│ ├── medium.cpp
│ └── splitfile.cpp
├── gcodeworkshop
├── gcodeworkshop.pro
├── images
│ ├── edytornc.ico
│ ├── edytornc48.ico
│ └── ncfile.ico
├── include
│ ├── document.h
│ ├── documentinfo.h
│ ├── documentmanager.h
│ ├── documentproducer.h
│ ├── documentstyle.h
│ ├── documentwidgetproperties.h
│ ├── gcoderdocument.h
│ ├── gcoderstyle.h
│ ├── gcoderwidgetproperties.h
│ ├── gcodeworkshop.h
│ └── utils
│ │ ├── expressionparser.h
│ │ └── removezeros.h
└── src
│ ├── capslockeventfilter.cpp
│ ├── capslockeventfilter.h
│ ├── document.cpp
│ ├── documentinfo.cpp
│ ├── documentmanager.cpp
│ ├── documentproducer.cpp
│ ├── documentstyle.cpp
│ ├── documentwidgetcloseeventfilter.cpp
│ ├── documentwidgetcloseeventfilter.h
│ ├── documentwidgetproperties.cpp
│ ├── findinf.cpp
│ ├── findinf.h
│ ├── findinfilesdialog.ui
│ ├── gcoder.h
│ ├── gcoderdocument.cpp
│ ├── gcodereventfilter.cpp
│ ├── gcodereventfilter.h
│ ├── gcoderinfo.cpp
│ ├── gcoderinfo.h
│ ├── gcoderproducer.cpp
│ ├── gcoderproducer.h
│ ├── gcoderstyle.cpp
│ ├── gcoderwidgetproperties.cpp
│ ├── gcodeworkshop.cpp
│ ├── gcodeworkshop.ui
│ ├── highlighter.cpp
│ ├── highlighter.h
│ ├── highlightmode.h
│ ├── inlinecalc.cpp
│ ├── inlinecalc.h
│ ├── main.cpp
│ ├── newfiledialog.cpp
│ ├── newfiledialog.h
│ ├── newfiledialog.ui
│ ├── recentfiles.cpp
│ ├── recentfiles.h
│ ├── sessiondialog.cpp
│ ├── sessiondialog.h
│ ├── sessiondialog.ui
│ ├── sessionmanager.cpp
│ ├── sessionmanager.h
│ ├── sessionnamedialog.cpp
│ ├── sessionnamedialog.h
│ ├── sessionnamedialog.ui
│ ├── setupdialog.cpp
│ ├── setupdialog.h
│ ├── setupdialog.ui
│ ├── tooltips.h
│ └── utils
│ ├── expressionparser.cpp
│ └── removezeros.cpp
├── gcodeworkshop_top.pro
├── install
├── MSYS2-deploy.sh
├── build-deb.sh
├── build-helper.sh
├── build-win-msys2.sh
├── linux
│ ├── application-x-g-code.xml
│ ├── gcodeworkshop.desktop
│ └── images
│ │ └── hicolor
│ │ ├── 32x32
│ │ └── mimetypes
│ │ │ └── application-x-g-code.png
│ │ └── 48x48
│ │ └── apps
│ │ └── edytornc.png
└── win-installer.nsi
├── lang
├── gcodeworkshop_ca.ts
├── gcodeworkshop_cs_CZ.ts
├── gcodeworkshop_de.ts
├── gcodeworkshop_es.ts
├── gcodeworkshop_fi.ts
├── gcodeworkshop_nl.ts
├── gcodeworkshop_pl.ts
├── gcodeworkshop_ru.ts
├── kdiff3_ca.ts
├── kdiff3_cs_CZ.ts
├── kdiff3_de.ts
├── kdiff3_es.ts
├── kdiff3_fi.ts
├── kdiff3_nl.ts
├── kdiff3_pl.ts
├── kdiff3_ru.ts
├── lang.pri
└── languages.txt
├── template
├── FANUC0T.nc
└── HAAS.nc
└── tools
├── README.md
├── astyle.cfg
├── codespell.cfg
├── iwyu.imp
├── iwyu_clang.imp
├── iwyu_comp.sh
├── iwyu_qtcore.imp
├── iwyu_qtextra.imp
├── iwyu_qtgui.imp
├── iwyu_qtnetwork.imp
├── iwyu_qtprintsupport.imp
├── iwyu_qtserialport.imp
├── iwyu_qtwidgets.imp
└── iwyu_qtxml.imp
/.github/workflows/build_tests.yml:
--------------------------------------------------------------------------------
1 | name: build tests
2 |
3 | on:
4 | push:
5 | branches-ignore:
6 | - master
7 | tags-ignore:
8 | pull_request:
9 |
10 | env:
11 | ACTIONS_ALLOW_UNSECURE_COMMANDS: true
12 |
13 | jobs:
14 | build:
15 | name: ${{ matrix.config.name }}-Qt${{ matrix.qt.version}}
16 | runs-on: ${{ matrix.config.os }}
17 | #continue-on-error: true
18 | strategy:
19 | fail-fast: false
20 | matrix:
21 | qt:
22 | - {
23 | version: 5.15.*,
24 | archives: icu qtbase qtprintsupport qtnetwork qttools qttranslations qtserialport,
25 | modules: ""
26 | }
27 | - {
28 | # https://doc.qt.io/qt.html
29 | version: 6.2.*,
30 | archives: icu qtbase qtprintsupport qtnetwork qttools qttranslations,
31 | modules: qtserialport qt5compat
32 | }
33 | config:
34 | - {
35 | name: Win_x64,
36 | os: windows-2019,
37 | q_extra: "",
38 | build: nmake
39 | }
40 | - {
41 | name: Linux_x64,
42 | os: ubuntu-22.04,
43 | q_extra: "",
44 | build: make
45 | }
46 | - {
47 | name: macOS_x64,
48 | os: macos-13,
49 | # https://stackoverflow.com/a/77631382
50 | q_extra: "-early QMAKE_DEFAULT_LIBDIRS=$(xcrun -show-sdk-path)/usr/lib",
51 | build: make
52 | }
53 |
54 | steps:
55 | - name: checkout
56 | uses: actions/checkout@v4
57 |
58 | - name: MSVC Environment Setup
59 | if: contains( matrix.config.os, 'Windows' )
60 | uses: ilammy/msvc-dev-cmd@v1
61 |
62 | - name: Install Qt
63 | uses: jurplel/install-qt-action@v4
64 | with:
65 | cache: true
66 | version: ${{ matrix.qt.version}}
67 | archives: ${{ matrix.qt.archives}}
68 | modules: ${{ matrix.qt.modules}}
69 |
70 | - name: Setup project
71 | run: qmake -recursive CONFIG+=debug ${{ matrix.config.q_extra }}
72 |
73 | - name: Build project
74 | run: ${{ matrix.config.build }}
75 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | bin/
3 | build/
4 | doc/html
5 | lang/*.qm
6 |
7 | /gcodeworkshop_top.pro.user*
8 | *.autosave
9 |
10 | /Makefile
11 | /src/Makefile*
12 |
13 | /3rdparty/lib/*release
14 | /3rdparty/lib/*debug
15 | /3rdparty/Makefile
16 | /3rdparty/*/Makefile
17 |
18 | *object_script.*
19 | *.stash
20 |
--------------------------------------------------------------------------------
/3rdparty/3rdparty.pro:
--------------------------------------------------------------------------------
1 |
2 | TEMPLATE = subdirs
3 | SUBDIRS = kdiff3 qtsingleapplication basic
4 |
--------------------------------------------------------------------------------
/3rdparty/basic/basic.pro:
--------------------------------------------------------------------------------
1 |
2 | TEMPLATE = lib
3 | TARGET = basic
4 | CONFIG += staticlib
5 |
6 | USE -= check_iwyu
7 |
8 | include(../../common.pri)
9 |
10 | HEADERS += basic_interpreter.h
11 | SOURCES += basic_interpreter.cpp
12 |
--------------------------------------------------------------------------------
/3rdparty/include/QtLockedFile:
--------------------------------------------------------------------------------
1 | #include "../qtsingleapplication/qtlockedfile.h"
2 |
--------------------------------------------------------------------------------
/3rdparty/include/QtSingleApplication:
--------------------------------------------------------------------------------
1 | #include "../qtsingleapplication/qtsingleapplication.h"
2 |
--------------------------------------------------------------------------------
/3rdparty/kdiff3/compatibility.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #ifndef COMPATIBILITY_H
19 | #define COMPATIBILITY_H
20 |
21 | #include // QT_VERSION QT_VERSION_CHECK
22 | #include
23 |
24 | inline int fontWidth(const QFontMetrics &fm)
25 | {
26 | #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
27 | return fm.width('W');
28 | #else
29 | return fm.horizontalAdvance('W');
30 | #endif
31 | }
32 |
33 | inline bool isFontFixed(const QFontMetrics &fm)
34 | {
35 | #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
36 | return fm.width('W') == fm.width('i');
37 | #else
38 | return fm.horizontalAdvance('W') == fm.horizontalAdvance('i');
39 | #endif
40 | }
41 |
42 | #endif // COMPATIBILITY_H
43 |
--------------------------------------------------------------------------------
/3rdparty/kdiff3/kdiff3.pro:
--------------------------------------------------------------------------------
1 | # part of http://kdiff3.sourceforge.net/
2 |
3 | TEMPLATE = lib
4 | TARGET = kdiff3
5 | CONFIG += staticlib
6 |
7 | USE -= check_iwyu
8 |
9 | include(../../common.pri)
10 |
11 | QT *= widgets
12 | # QTextCodec in Qt6
13 | greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
14 |
15 | SOURCES += \
16 | difftextwindow.cpp \
17 | diff.cpp \
18 | merger.cpp \
19 | optiondialog.cpp \
20 | common.cpp \
21 | fileaccess.cpp \
22 | kdiff3.cpp \
23 | gnudiff_xmalloc.cpp \
24 | gnudiff_io.cpp \
25 | gnudiff_analyze.cpp \
26 | pdiff.cpp \
27 | mergeresultwindow.cpp
28 |
29 | HEADERS += \
30 | difftextwindow.h \
31 | diff.h \
32 | merger.h \
33 | optiondialog.h \
34 | common.h \
35 | fileaccess.h \
36 | kdiff3.h \
37 | gnudiff_system.h \
38 | gnudiff_diff.h \
39 | mergeresultwindow.h \
40 | compatibility.h
41 |
--------------------------------------------------------------------------------
/3rdparty/kdiff3/merger.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | merger.h - description
3 | -------------------
4 | begin : Sun Mar 24 2002
5 | copyright : (C) 2002-2007 by Joachim Eibl
6 | email : joachim.eibl at gmx.de
7 | ***************************************************************************/
8 |
9 | /***************************************************************************
10 | * *
11 | * This program is free software; you can redistribute it and/or modify *
12 | * it under the terms of the GNU General Public License as published by *
13 | * the Free Software Foundation; either version 2 of the License, or *
14 | * (at your option) any later version. *
15 | * *
16 | ***************************************************************************/
17 |
18 | #ifndef MERGER_H
19 | #define MERGER_H
20 |
21 | #include "diff.h"
22 |
23 |
24 | class Merger
25 | {
26 | public:
27 | Merger(const DiffList *pDiffList1, const DiffList *pDiffList2);
28 |
29 | /** Go one step. */
30 | void next();
31 |
32 | /** Information about what changed. Can be used for coloring.
33 | The return value is 0 if nothing changed here,
34 | bit 1 is set if a difference from pDiffList1 was detected,
35 | bit 2 is set if a difference from pDiffList2 was detected.
36 | */
37 | int whatChanged();
38 |
39 | /** End of both diff lists reached. */
40 | bool isEndReached();
41 |
42 | private:
43 | struct MergeData {
44 | DiffList::const_iterator it;
45 | const DiffList *pDiffList;
46 | Diff d;
47 | int idx;
48 |
49 | MergeData(const DiffList *p, int i);
50 | bool eq();
51 | void update();
52 | bool isEnd();
53 | };
54 |
55 | MergeData md1;
56 | MergeData md2;
57 | };
58 |
59 | #endif // MERGER_H
60 |
--------------------------------------------------------------------------------
/3rdparty/qtsingleapplication/qtsingleapplication.pri:
--------------------------------------------------------------------------------
1 | include(../common.pri)
2 | INCLUDEPATH += $$PWD
3 | DEPENDPATH += $$PWD
4 | QT *= network
5 | greaterThan(QT_MAJOR_VERSION, 4): QT *= widgets
6 |
7 | qtsingleapplication-uselib:!qtsingleapplication-buildlib {
8 | LIBS += -L$$QTSINGLEAPPLICATION_LIBDIR -l$$QTSINGLEAPPLICATION_LIBNAME
9 | } else {
10 | SOURCES += $$PWD/qtsingleapplication.cpp $$PWD/qtlocalpeer.cpp
11 | HEADERS += $$PWD/qtsingleapplication.h $$PWD/qtlocalpeer.h
12 | }
13 |
14 | win32 {
15 | contains(TEMPLATE, lib):contains(CONFIG, shared):DEFINES += QT_QTSINGLEAPPLICATION_EXPORT
16 | else:qtsingleapplication-uselib:DEFINES += QT_QTSINGLEAPPLICATION_IMPORT
17 | }
18 |
--------------------------------------------------------------------------------
/3rdparty/qtsingleapplication/qtsingleapplication.pro:
--------------------------------------------------------------------------------
1 | # part of https://github.com/qtproject/qt-solutions/tree/master/qtsingleapplication
2 |
3 | TEMPLATE = lib
4 | TARGET = qtsingleapplication
5 | CONFIG += staticlib
6 |
7 | USE -= check_iwyu
8 |
9 | include(../../common.pri)
10 |
11 | QT *= widgets network
12 |
13 | SOURCES += \
14 | qtsingleapplication.cpp \
15 | qtlocalpeer.cpp \
16 | qtlockedfile_win.cpp \
17 | qtlockedfile_unix.cpp \
18 | qtlockedfile.cpp
19 |
20 | HEADERS += \
21 | qtsingleapplication.h \
22 | qtlockedfile.h \
23 | qtlocalpeer.h
24 |
--------------------------------------------------------------------------------
/3rdparty/qtsingleapplication/qtsinglecoreapplication.pri:
--------------------------------------------------------------------------------
1 | INCLUDEPATH += $$PWD
2 | DEPENDPATH += $$PWD
3 | HEADERS += $$PWD/qtsinglecoreapplication.h $$PWD/qtlocalpeer.h
4 | SOURCES += $$PWD/qtsinglecoreapplication.cpp $$PWD/qtlocalpeer.cpp
5 |
6 | QT *= network
7 |
8 | win32:contains(TEMPLATE, lib):contains(CONFIG, shared) {
9 | DEFINES += QT_QTSINGLECOREAPPLICATION_EXPORT=__declspec(dllexport)
10 | }
11 |
--------------------------------------------------------------------------------
/addons/addons.pro:
--------------------------------------------------------------------------------
1 |
2 | VERSION = 2023.03
3 | TEMPLATE = lib
4 | TARGET = addons
5 | CONFIG += staticlib
6 |
7 | QT *= widgets
8 | MODULES *= GCodeWorkShop GCodeShared basic
9 |
10 | include(../common.pri)
11 |
12 | INCLUDEPATH += include
13 |
14 | HEADERS += \
15 | include/addons-actions.h \
16 | src/addons-context.h
17 |
18 | SOURCES += \
19 | src/addons-actions.cpp \
20 | src/addons-context.cpp
21 |
22 | include(src/bhc/bhc.pri)
23 | include(src/blockskip/blockskip.pri)
24 | include(src/chamfer/chamfer.pri)
25 | include(src/cleanup/cleanup.pri)
26 | include(src/comment/comment.pri)
27 | include(src/compilemacro/compilemacro.pri)
28 | include(src/dot/dot.pri)
29 | include(src/emptylines/emptylines.pri)
30 | include(src/feeds/feeds.pri)
31 | include(src/i2m/i2m.pri)
32 | include(src/i2mprog/i2mprog.pri)
33 | include(src/renumber/renumber.pri)
34 | include(src/spaces/spaces.pri)
35 | include(src/swapaxes/swapaxes.pri)
36 | include(src/triangle/triangle.pri)
37 |
--------------------------------------------------------------------------------
/addons/src/addons-context.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_CONTEXT_H
21 | #define ADDONS_CONTEXT_H
22 |
23 | #include // for QString
24 |
25 | class QPlainTextEdit;
26 |
27 |
28 | namespace Addons {
29 | class Context
30 | {
31 | public:
32 | enum Mode {
33 | // Only selected text.
34 | SELECTED,
35 | // From the start of the first selected block to the end of the last
36 | // selected block; or the block in which the cursor is placed.
37 | SELECTED_BLOCKS,
38 | // Selected or whole text.
39 | SELECTED_OR_ALL,
40 | // Whole text.
41 | ALL
42 | };
43 |
44 | bool pull(int mode);
45 |
46 | QString& text()
47 | {
48 | return m_text;
49 | }
50 |
51 | int fragmentStart()
52 | {
53 | return m_fragmentStart;
54 | }
55 |
56 | int fragmentEnd()
57 | {
58 | return m_fragmentEnd;
59 | }
60 |
61 | void setSelectionStart(int pos)
62 | {
63 | m_selectionStart = pos;
64 | }
65 |
66 | void setSelectionEnd(int pos)
67 | {
68 | m_selectionEnd = pos;
69 | }
70 |
71 | void push(const QString& text);
72 |
73 | void push();
74 |
75 | QPlainTextEdit* textEdit()
76 | {
77 | return m_edit;
78 | }
79 |
80 | protected:
81 | int m_mode;
82 | QPlainTextEdit* m_edit;
83 | int m_selectionStart; // QPlainTextEdit::selectionStart()
84 | int m_selectionEnd; // QPlainTextEdit::selectionEnd()
85 | int m_fragmentStart;
86 | int m_fragmentEnd;
87 | QString m_text;
88 | };
89 | } // namespace Addons
90 |
91 | #endif // ADDONS_CONTEXT_H
92 |
--------------------------------------------------------------------------------
/addons/src/bhc/addons-bhc.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for QString
22 | #include // for QWidget
23 |
24 | #include "addons-bhc.h"
25 | #include "bhcdialog.h" // for BHCDialog
26 |
27 |
28 | void Addons::doBhc(QWidget* parent, QSettings* settings)
29 | {
30 | QString key = "BHCDialog";
31 | BHCDialog* dlg;
32 | dlg = parent->findChild(key);
33 |
34 | if (!dlg) {
35 | dlg = new BHCDialog(parent, settings);
36 | dlg->setObjectName(key);
37 | dlg->loadSettings();
38 | }
39 |
40 | dlg->show();
41 | }
42 |
--------------------------------------------------------------------------------
/addons/src/bhc/addons-bhc.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_BHC_H
21 | #define ADDONS_BHC_H
22 |
23 | class QSettings;
24 | class QWidget;
25 |
26 |
27 | namespace Addons {
28 | void doBhc(QWidget* parent, QSettings* settings);
29 | }
30 |
31 | #endif // ADDONS_BHC_H
32 |
--------------------------------------------------------------------------------
/addons/src/bhc/bhc.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-bhc.h
2 | SOURCES += $$PWD/addons-bhc.cpp
3 |
4 | HEADERS += $$PWD/bhcoptions.h $$PWD/bhctaboptions.h
5 | SOURCES += $$PWD/bhcoptions.cpp $$PWD/bhctaboptions.cpp
6 |
7 | HEADERS += $$PWD/bhcdialog.h $$PWD/bhcdraw.h $$PWD/bhctab.h
8 | SOURCES += $$PWD/bhcdialog.cpp $$PWD/bhcdraw.cpp $$PWD/bhctab.cpp
9 | FORMS += $$PWD/bhcdialog.ui $$PWD/bhctab.ui
10 |
--------------------------------------------------------------------------------
/addons/src/bhc/bhcdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef BHCDIALOG_H
22 | #define BHCDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for Q_OBJECT, slots
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QSettings;
30 | class QTabWidget;
31 | class QWidget;
32 |
33 | class BHCDraw;
34 | struct BHCOptions;
35 |
36 | #include "ui_bhcdialog.h" // for Ui::BHCDialog
37 |
38 |
39 | /**
40 | * @brief The BHCDialog class
41 | */
42 | class BHCDialog : public QDialog, private Ui::BHCDialog
43 | {
44 | Q_OBJECT
45 |
46 | public:
47 | BHCDialog(QWidget* parent, QSettings* settings);
48 | ~BHCDialog();
49 |
50 | void setOptions(const BHCOptions& options);
51 | BHCOptions options();
52 |
53 | void loadSettings();
54 | void saveSettings(bool saveOptions = true);
55 |
56 | protected:
57 | //void windowActivationChange(bool oldActive);
58 |
59 | private slots:
60 | void comChk();
61 | void computeButtonClicked();
62 | void clearAll();
63 | void onFinished(int result);
64 |
65 | private:
66 | QTabWidget* tabBar;
67 | BHCDraw* drawing;
68 |
69 | int parentHeight;
70 | int parentWidth;
71 |
72 | protected:
73 | QPointer mSettings;
74 | };
75 |
76 | #endif // BHCDIALOG_H
77 |
--------------------------------------------------------------------------------
/addons/src/bhc/bhcdraw.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef BHCDDRAW_H
22 | #define BHCDDRAW_H
23 |
24 | #include // for QColor
25 | #include // for slots, Q_OBJECT
26 | #include // for QString
27 | #include // for QWidget
28 | #include // for WindowType, operator|, GlobalColor, WindowFlags
29 | #include // for qreal, QFlags
30 |
31 | class QFocusEvent;
32 | class QMouseEvent;
33 | class QPaintEvent;
34 | class QPixmap;
35 |
36 |
37 | /**
38 | * @brief The BHCDraw class
39 | */
40 | class BHCDraw : public QWidget
41 | {
42 | Q_OBJECT
43 |
44 | public:
45 | BHCDraw(QWidget* parent = 0,
46 | Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::Tool);
47 | ~BHCDraw();
48 |
49 | public slots:
50 | void clear();
51 | void printText(int x, int y, int line, const QString& text, QColor color);
52 | void drawHole(qreal ang, qreal dia, qreal xcenter, qreal ycenter, bool first = false,
53 | bool last = false, QColor color = Qt::green);
54 | void init(int w, int h);
55 | void drawLines(qreal dia, qreal ang, QColor cl);
56 | void setScale(double sc);
57 |
58 | private slots:
59 | void drawLines();
60 |
61 | protected:
62 | void paintEvent(QPaintEvent*);
63 | void focusOutEvent(QFocusEvent*);
64 | void mousePressEvent(QMouseEvent* event);
65 |
66 | private:
67 | double scale;
68 | QPixmap* pm;
69 | };
70 |
71 | #endif // BHCDDRAW_H
72 |
--------------------------------------------------------------------------------
/addons/src/bhc/bhcoptions.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for QSettings
21 |
22 | #include "bhcoptions.h"
23 | #include "bhctaboptions.h" // for BHCTabOptions
24 |
25 |
26 | #define CFG_SECTION_GREEN "GreenTab"
27 | #define CFG_SECTION_BLUE "BlueTab"
28 | #define CFG_SECTION_RED "RedTab"
29 | #define CFG_SECTION_YELLOW "YellowTab"
30 |
31 |
32 | BHCOptions::BHCOptions() :
33 | green{},
34 | blue{},
35 | red{},
36 | yellow{}
37 | {
38 | }
39 |
40 | void BHCOptions::load(QSettings* settings)
41 | {
42 | settings->beginGroup(CFG_SECTION_GREEN);
43 | green.load(settings);
44 | settings->endGroup();
45 |
46 | settings->beginGroup(CFG_SECTION_BLUE);
47 | blue.load(settings);
48 | settings->endGroup();
49 |
50 | settings->beginGroup(CFG_SECTION_RED);
51 | red.load(settings);
52 | settings->endGroup();
53 |
54 | settings->beginGroup(CFG_SECTION_YELLOW);
55 | yellow.load(settings);
56 | settings->endGroup();
57 | }
58 |
59 | void BHCOptions::save(QSettings* settings)
60 | {
61 | settings->beginGroup(CFG_SECTION_GREEN);
62 | green.save(settings);
63 | settings->endGroup();
64 |
65 | settings->beginGroup(CFG_SECTION_BLUE);
66 | blue.save(settings);
67 | settings->endGroup();
68 |
69 | settings->beginGroup(CFG_SECTION_RED);
70 | red.save(settings);
71 | settings->endGroup();
72 |
73 | settings->beginGroup(CFG_SECTION_YELLOW);
74 | yellow.save(settings);
75 | settings->endGroup();
76 | }
77 |
--------------------------------------------------------------------------------
/addons/src/bhc/bhcoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef BHCOPTIONS_H
21 | #define BHCOPTIONS_H
22 |
23 | class QSettings;
24 |
25 | #include "bhctaboptions.h"
26 |
27 |
28 | struct BHCOptions {
29 | BHCOptions();
30 |
31 | BHCTabOptions green;
32 | BHCTabOptions blue;
33 | BHCTabOptions red;
34 | BHCTabOptions yellow;
35 |
36 | void load(QSettings* settings);
37 | void save(QSettings* settings);
38 | };
39 |
40 | #endif // BHCOPTIONS_H
41 |
--------------------------------------------------------------------------------
/addons/src/bhc/bhctab.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef BHCDTAB_H
22 | #define BHCDTAB_H
23 |
24 | #include // for slots, Q_OBJECT, signals
25 | #include // for QString
26 | #include // for QWidget
27 |
28 | class QAbstractItemModel;
29 | class QAction;
30 | class QActionGroup;
31 | class QEvent;
32 | class QMenu;
33 | class QPoint;
34 |
35 | struct BHCTabOptions;
36 |
37 | #include "ui_bhctab.h" // for Ui::BHCTab
38 |
39 |
40 | /**
41 | * @brief The BHCTab class
42 | */
43 | class BHCTab : public QWidget, public Ui::BHCTab
44 | {
45 | Q_OBJECT
46 |
47 | public:
48 | BHCTab(QWidget* parent = 0);
49 | ~BHCTab();
50 |
51 | void setOptions(const BHCTabOptions& options);
52 | BHCTabOptions options();
53 |
54 | protected:
55 | bool eventFilter(QObject* obj, QEvent* ev);
56 |
57 | protected slots:
58 | void contextMenuReq(const QPoint& pos);
59 | void inputChk();
60 |
61 | signals:
62 | void commonChk();
63 |
64 | private slots:
65 | void copySelection();
66 | void sellAll();
67 | void inputChanged();
68 |
69 | private:
70 | QMenu* contextMenu;
71 | QAbstractItemModel* model;
72 | QAction* addCommentsId;
73 | QAction* addCommentsParaId;
74 | QActionGroup* commentActGroup;
75 | };
76 |
77 | #endif // BHCDTAB_H
78 |
--------------------------------------------------------------------------------
/addons/src/bhc/bhctaboptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef BHCTABOPTIONS_H
21 | #define BHCTABOPTIONS_H
22 |
23 | class QSettings;
24 |
25 |
26 | struct BHCTabOptions {
27 | BHCTabOptions();
28 |
29 | double x;
30 | double y;
31 | double diam;
32 | double start;
33 | double step;
34 | int count;
35 | int rotate;
36 | bool mirrorX;
37 | bool mirrorY;
38 | bool common;
39 |
40 | void load(QSettings* settings);
41 | void save(QSettings* settings);
42 | };
43 |
44 | #endif // BHCTABOPTIONS_H
45 |
--------------------------------------------------------------------------------
/addons/src/blockskip/blockskip.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/utils-blockskip.h
2 | SOURCES += $$PWD/utils-blockskip.cpp
3 |
--------------------------------------------------------------------------------
/addons/src/blockskip/utils-blockskip.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_BLOCKSKIP_H
21 | #define UTILS_BLOCKSKIP_H
22 |
23 | class QString;
24 |
25 |
26 | namespace Utils {
27 | void blockSkip(QString& tx, bool remove, bool inc);
28 | }
29 |
30 | #endif // UTILS_BLOCKSKIP_H
31 |
--------------------------------------------------------------------------------
/addons/src/chamfer/addons-chamfer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for QString
22 | #include // for QWidget
23 |
24 | #include "addons-chamfer.h"
25 | #include "chamferdialog.h" // for ChamferDialog
26 |
27 |
28 | void Addons::doChamfer(QWidget* parent, QSettings* settings)
29 | {
30 | QString key = "ChamferDialog";
31 | ChamferDialog* dlg;
32 | dlg = parent->findChild(key);
33 |
34 | if (!dlg) {
35 | dlg = new ChamferDialog(parent, settings);
36 | dlg->setObjectName(key);
37 | dlg->loadSettings();
38 | }
39 |
40 | dlg->show();
41 | }
42 |
--------------------------------------------------------------------------------
/addons/src/chamfer/addons-chamfer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_CHAMFER_H
21 | #define ADDONS_CHAMFER_H
22 |
23 | class QSettings;
24 | class QWidget;
25 |
26 |
27 | namespace Addons {
28 | void doChamfer(QWidget* parent, QSettings* settings);
29 | }
30 |
31 | #endif // ADDONS_CHAMFER_H
32 |
--------------------------------------------------------------------------------
/addons/src/chamfer/chamfer.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-chamfer.h
2 | SOURCES += $$PWD/addons-chamfer.cpp
3 |
4 | HEADERS += $$PWD/chamferoptions.h
5 | SOURCES += $$PWD/chamferoptions.cpp
6 |
7 | HEADERS += $$PWD/chamferdialog.h
8 | SOURCES += $$PWD/chamferdialog.cpp
9 | FORMS += $$PWD/chamferdialog.ui
10 |
--------------------------------------------------------------------------------
/addons/src/chamfer/chamferdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef CHAMFERDIALOG_H
22 | #define CHAMFERDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for slots, Q_OBJECT
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QSettings;
30 | class QWidget;
31 |
32 | struct ChamferOptions;
33 |
34 | #include "ui_chamferdialog.h" // for Ui::ChamferDialog
35 |
36 |
37 | /**
38 | * @brief The ChamferDialog class
39 | */
40 | class ChamferDialog : public QDialog, private Ui::ChamferDialog
41 | {
42 | Q_OBJECT
43 |
44 | public:
45 | ChamferDialog(QWidget* parent, QSettings* settings);
46 | ~ChamferDialog();
47 |
48 | void setOptions(const ChamferOptions& options);
49 | ChamferOptions options();
50 |
51 | void loadSettings();
52 | void saveSettings(bool saveOptions = true);
53 |
54 | protected slots:
55 | void inputChanged();
56 | void checkBoxToggled();
57 |
58 | private slots:
59 | void computeButtonClicked();
60 | void onFinished(int result);
61 |
62 | protected:
63 | QPointer mSettings;
64 | };
65 |
66 | #endif // CHAMFERDIALOG_H
67 |
--------------------------------------------------------------------------------
/addons/src/chamfer/chamferoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef CHAMFEROPTIONS_H
21 | #define CHAMFEROPTIONS_H
22 |
23 | class QSettings;
24 |
25 |
26 | struct ChamferOptions {
27 | ChamferOptions();
28 |
29 | struct InOut {
30 | bool in;
31 | double value;
32 | };
33 |
34 | InOut angle;
35 | InOut width;
36 | InOut height;
37 | InOut minDiam;
38 | InOut maxDiam;
39 |
40 | void load(QSettings* settings);
41 | void save(QSettings* settings);
42 | };
43 |
44 | #endif // CHAMFEROPTIONS_H
45 |
--------------------------------------------------------------------------------
/addons/src/cleanup/addons-cleanup.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_CLEANUP_H
21 | #define ADDONS_CLEANUP_H
22 |
23 | class QSettings;
24 | class QString;
25 | class QWidget;
26 |
27 |
28 | namespace Addons {
29 | bool doCleanUp(QWidget* parent, QSettings* settings, QString& tx);
30 | }
31 |
32 | #endif // ADDONS_CLEANUP_H
33 |
--------------------------------------------------------------------------------
/addons/src/cleanup/cleanup.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-cleanup.h
2 | SOURCES += $$PWD/addons-cleanup.cpp
3 |
4 | HEADERS += $$PWD/cleanupoptions.h
5 | SOURCES += $$PWD/cleanupoptions.cpp
6 |
7 | HEADERS += $$PWD/cleanupdialog.h
8 | SOURCES += $$PWD/cleanupdialog.cpp
9 | FORMS += $$PWD/cleanupdialog.ui
10 |
11 | HEADERS += $$PWD/utils-removebyregex.h
12 | SOURCES += $$PWD/utils-removebyregex.cpp
13 |
--------------------------------------------------------------------------------
/addons/src/cleanup/cleanupdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef CLEANUPDIALOG_H
22 | #define CLEANUPDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for Q_OBJECT, slots
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QMenu;
30 | class QPoint;
31 | class QRegularExpression;
32 | class QSettings;
33 | class QWidget;
34 |
35 | struct CleanUpOptions;
36 |
37 | #include "ui_cleanupdialog.h" // for Ui::CleanUpDialog
38 |
39 |
40 | class CleanUpDialog : public QDialog, private Ui::CleanUpDialog
41 | {
42 | Q_OBJECT
43 |
44 | public:
45 | explicit CleanUpDialog(QWidget* parent, QSettings* settings);
46 | ~CleanUpDialog();
47 |
48 | void setText(QString text);
49 |
50 | void setOptions(const CleanUpOptions& options);
51 | CleanUpOptions options();
52 |
53 | void loadSettings();
54 | void saveSettings(bool saveOptions = true);
55 |
56 | private:
57 | QMenu* contextMenu;
58 |
59 | void highlightFindText(QRegularExpression regex);
60 | void newRow();
61 |
62 | private slots:
63 | void onCellCliced(int row, int col);
64 | void highlightText(int row, int col);
65 | void cellChangedSlot(int row, int col);
66 | void contextMenuReq(const QPoint& pos);
67 | void removeRow();
68 | void onFinished(int result);
69 |
70 | protected:
71 | QPointer mSettings;
72 | };
73 |
74 | #endif // CLEANUPDIALOG_H
75 |
--------------------------------------------------------------------------------
/addons/src/cleanup/cleanupoptions.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for QSettings
21 | #include // for QStringList
22 | #include // for QVariant
23 |
24 | #include "cleanupoptions.h"
25 |
26 |
27 | #define CFG_KEY_COMMENTS "Comments"
28 | #define CFG_KEY_EXPRESSIONS "Expressions"
29 | #define CFG_KEY_SELECTED "Selected"
30 |
31 |
32 | CleanUpOptions::CleanUpOptions() :
33 | expressions{},
34 | comments{},
35 | selected{}
36 | {
37 | }
38 |
39 | void CleanUpOptions::load(QSettings* settings)
40 | {
41 | comments = settings->value(CFG_KEY_COMMENTS, comments).toStringList();
42 | expressions = settings->value(CFG_KEY_EXPRESSIONS, expressions).toStringList();
43 | selected = settings->value(CFG_KEY_SELECTED, selected).toStringList();
44 | }
45 |
46 | void CleanUpOptions::save(QSettings* settings)
47 | {
48 | if (expressions.isEmpty()) {
49 | settings->remove(CFG_KEY_COMMENTS);
50 | settings->remove(CFG_KEY_EXPRESSIONS);
51 | settings->remove(CFG_KEY_SELECTED);
52 | } else {
53 | settings->setValue(CFG_KEY_COMMENTS, comments);
54 | settings->setValue(CFG_KEY_EXPRESSIONS, expressions);
55 | settings->setValue(CFG_KEY_SELECTED, selected);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/addons/src/cleanup/cleanupoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef CLEANUPOPTIONS_H
21 | #define CLEANUPOPTIONS_H
22 |
23 | #include // for QStringList
24 |
25 | class QSettings;
26 |
27 |
28 | struct CleanUpOptions {
29 | CleanUpOptions();
30 |
31 | QStringList expressions;
32 | QStringList comments;
33 | QStringList selected;
34 |
35 | void load(QSettings* settings);
36 | void save(QSettings* settings);
37 | };
38 |
39 | #endif // CLEANUPOPTIONS_H
40 |
--------------------------------------------------------------------------------
/addons/src/cleanup/utils-removebyregex.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_REMOVEBYREGEX_H
21 | #define UTILS_REMOVEBYREGEX_H
22 |
23 | #include // for function
24 |
25 | #include // for QStringList
26 |
27 | class QString;
28 |
29 |
30 | namespace Utils {
31 | bool removeTextByRegExp(QString& tx,
32 | const QStringList& expList,
33 | bool replaceDollar,
34 | const std::function& interrupt);
35 | }
36 |
37 | #endif // UTILSREMOVEBY_REGEX_H
38 |
--------------------------------------------------------------------------------
/addons/src/comment/comment.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/utils-comment.h
2 | SOURCES += $$PWD/utils-comment.cpp
3 |
--------------------------------------------------------------------------------
/addons/src/comment/utils-comment.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_COMMENT_H
21 | #define UTILS_COMMENT_H
22 |
23 | #include // for function
24 |
25 | class QString;
26 |
27 |
28 | namespace Utils {
29 |
30 | enum CommentMode {
31 | ParenthesisComments,
32 | SemicolonComments
33 | };
34 |
35 | bool autoComments(QString& text, int mode, const std::function& interrupt);
36 | bool parenthesisComments(QString& line, bool remove);
37 | bool semicolonComments(QString& line, bool remove);
38 |
39 | } // namespace Utils
40 |
41 | #endif // UTILS_COMMENT_H
42 |
--------------------------------------------------------------------------------
/addons/src/compilemacro/compilemacro.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/utils-compilemacro.h
2 | SOURCES += $$PWD/utils-compilemacro.cpp
3 |
--------------------------------------------------------------------------------
/addons/src/compilemacro/utils-compilemacro.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_COMPILEMACRO_H
21 | #define UTILS_COMPILEMACRO_H
22 |
23 | #include // for QString
24 |
25 |
26 | namespace Utils {
27 |
28 | class CompileMacro
29 | {
30 | public:
31 | int compile(const QString& text);
32 | const QString& result();
33 | const QString& status();
34 |
35 | protected:
36 | QString m_status;
37 | QString m_result;
38 |
39 | void setError(int error, const QString& tx);
40 | void setBasicError(int error);
41 | void cleanUp(QString& str) ;
42 | };
43 | }
44 |
45 | #endif // UTILS_COMPILEMACRO_H
46 |
--------------------------------------------------------------------------------
/addons/src/dot/addons-dot.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for function
22 |
23 | #include // for translate
24 | #include // for QDialog
25 | #include // for QString
26 | #include // for QWidget
27 |
28 | #include // for LongJobHelper, LongJobHelper::CANCEL
29 |
30 | #include "addons-dot.h"
31 | #include "dotdialog.h" // for DotDialog
32 | #include "dotoptions.h" // for DotOptions
33 | #include "utils-insertdot.h" // for insertDot
34 |
35 |
36 | int Addons::doDot(QWidget* parent, QSettings* settings, QString& tx)
37 | {
38 | int result = 0;
39 | QString key = "DotDialog";
40 | DotDialog* dlg;
41 | dlg = parent->findChild(key);
42 |
43 | if (!dlg) {
44 | dlg = new DotDialog(parent, settings);
45 | dlg->setObjectName(key);
46 | dlg->loadSettings();
47 | }
48 |
49 | if (dlg->exec() != QDialog::Accepted) {
50 | return 0;
51 | }
52 |
53 | LongJobHelper helper{parent};
54 | helper.begin(tx.length(), QCoreApplication::translate("Addons::Actions", "Inserting dots"), 20);
55 |
56 | DotOptions opt = dlg->options();
57 | result = Utils::insertDot(tx, opt.axes, opt.convert, opt.divider, [&helper](int pos) -> bool{
58 | return helper.check(pos) == LongJobHelper::CANCEL;
59 | });
60 |
61 | helper.end();
62 | dlg->deleteLater();
63 | return result;
64 | }
65 |
--------------------------------------------------------------------------------
/addons/src/dot/addons-dot.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_DOT_H
21 | #define ADDONS_DOT_H
22 |
23 | class QSettings;
24 | class QString;
25 | class QWidget;
26 |
27 |
28 | namespace Addons {
29 | int doDot(QWidget* parent, QSettings* settings, QString& tx);
30 | }
31 |
32 | #endif // ADDONS_DOT_H
33 |
--------------------------------------------------------------------------------
/addons/src/dot/dot.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-dot.h
2 | SOURCES += $$PWD/addons-dot.cpp
3 |
4 | HEADERS += $$PWD/dotoptions.h
5 | SOURCES += $$PWD/dotoptions.cpp
6 |
7 | HEADERS += $$PWD/dotdialog.h
8 | SOURCES += $$PWD/dotdialog.cpp
9 | FORMS += $$PWD/dotdialog.ui
10 |
11 | HEADERS += $$PWD/utils-insertdot.h
12 | SOURCES += $$PWD/utils-insertdot.cpp
13 |
--------------------------------------------------------------------------------
/addons/src/dot/dotdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef DOTDIALOG_H
22 | #define DOTDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for slots, Q_OBJECT
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QSettings;
30 | class QWidget;
31 |
32 | struct DotOptions;
33 |
34 | #include "ui_dotdialog.h" // for Ui::DotDialog
35 |
36 |
37 | /**
38 | * @brief The DotDialog class
39 | */
40 | class DotDialog : public QDialog, private Ui::DotDialog
41 | {
42 | Q_OBJECT
43 |
44 | public:
45 | DotDialog(QWidget* parent, QSettings* settings);
46 | ~DotDialog();
47 |
48 | void setOptions(const DotOptions& options);
49 | DotOptions options();
50 |
51 | void loadSettings();
52 | void saveSettings(bool saveOptions = true);
53 |
54 | private slots:
55 | void inputChanged(const QString& text);
56 | void atEndClicked();
57 | void divideClicked();
58 | void spinBoxVal(int val);
59 | void onFinished(int result);
60 |
61 | protected:
62 | QPointer mSettings;
63 | };
64 |
65 | #endif // DOTDIALOG_H
66 |
--------------------------------------------------------------------------------
/addons/src/dot/dotoptions.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for QSettings
21 | #include // for QVariant
22 |
23 | #include "dotoptions.h"
24 |
25 |
26 | #define CFG_KEY_AXES "Axes"
27 | #define CFG_KEY_CONVERT "Convert"
28 | #define CFG_KEY_DIVIDER "Divider"
29 |
30 |
31 | DotOptions::DotOptions() :
32 | axes{"XYZUVWCH"},
33 | convert{false},
34 | divider{3}
35 | {
36 | }
37 |
38 | void DotOptions::load(QSettings* settings)
39 | {
40 | axes = settings->value(CFG_KEY_AXES, axes).toString();
41 | convert = settings->value(CFG_KEY_CONVERT, convert).toBool();
42 | divider = settings->value(CFG_KEY_DIVIDER, divider).toInt();
43 | }
44 |
45 | void DotOptions::save(QSettings* settings)
46 | {
47 | settings->setValue(CFG_KEY_AXES, axes);
48 | settings->setValue(CFG_KEY_CONVERT, convert);
49 | settings->setValue(CFG_KEY_DIVIDER, divider);
50 | }
51 |
--------------------------------------------------------------------------------
/addons/src/dot/dotoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef DOTOPTIONS_H
21 | #define DOTOPTIONS_H
22 |
23 | #include // for QString
24 |
25 | class QSettings;
26 |
27 |
28 | struct DotOptions {
29 | DotOptions();
30 |
31 | QString axes;
32 | bool convert;
33 | int divider;
34 |
35 | void load(QSettings* settings);
36 | void save(QSettings* settings);
37 | };
38 |
39 | #endif // DOTOPTIONS_H
40 |
--------------------------------------------------------------------------------
/addons/src/dot/utils-insertdot.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef UTILS_INSERTDOT_H
22 | #define UTILS_INSERTDOT_H
23 |
24 | #include // for function
25 |
26 | class QString;
27 |
28 |
29 | namespace Utils {
30 | int insertDot(QString& tx, const QString& addr, bool convert, int divider, const std::function& interrupt);
31 | }
32 |
33 | #endif // UTILS_INSERTDOT_H
34 |
--------------------------------------------------------------------------------
/addons/src/emptylines/emptylines.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/utils-emptylines.h
2 | SOURCES += $$PWD/utils-emptylines.cpp
3 |
--------------------------------------------------------------------------------
/addons/src/emptylines/utils-emptylines.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_EMPTYLINES_H
21 | #define UTILS_EMPTYLINES_H
22 |
23 | #include // for function
24 |
25 | class QString;
26 |
27 |
28 | namespace Utils {
29 | bool insertEmptyLines(QString& tx, const std::function& interrupt);
30 | bool removeEmptyLines(QString& tx, const std::function& interrupt);
31 | }
32 |
33 | #endif // UTILS_EMPTYLINES_H
34 |
--------------------------------------------------------------------------------
/addons/src/feeds/addons-feeds.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for QString
22 | #include // for QWidget
23 |
24 | #include "addons-feeds.h"
25 | #include "feedsdialog.h" // for FeedsDialog
26 |
27 |
28 | void Addons::doFeeds(QWidget* parent, QSettings* settings)
29 | {
30 | QString key = "FeedsDialog";
31 | FeedsDialog* dlg;
32 | dlg = parent->findChild(key);
33 |
34 | if (!dlg) {
35 | dlg = new FeedsDialog(parent, settings);
36 | dlg->setObjectName(key);
37 | dlg->loadSettings();
38 | }
39 |
40 | dlg->show();
41 | }
42 |
--------------------------------------------------------------------------------
/addons/src/feeds/addons-feeds.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_FEEDS_H
21 | #define ADDONS_FEEDS_H
22 |
23 | class QSettings;
24 | class QWidget;
25 |
26 |
27 | namespace Addons {
28 | void doFeeds(QWidget* parent, QSettings* settings);
29 | }
30 |
31 | #endif // ADDONS_FEEDS_H
32 |
--------------------------------------------------------------------------------
/addons/src/feeds/feeds.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-feeds.h
2 | SOURCES += $$PWD/addons-feeds.cpp
3 |
4 | HEADERS += $$PWD/feedsoptions.h
5 | SOURCES += $$PWD/feedsoptions.cpp
6 |
7 | HEADERS += $$PWD/feedsdialog.h
8 | SOURCES += $$PWD/feedsdialog.cpp
9 | FORMS += $$PWD/feedsdialog.ui
10 |
--------------------------------------------------------------------------------
/addons/src/feeds/feedsdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef FEEDSDIALOG_H
22 | #define FEEDSDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for Q_OBJECT, slots
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QEvent;
30 | class QSettings;
31 | class QWidget;
32 |
33 | struct FeedsOptions;
34 |
35 | #include "ui_feedsdialog.h" // for Ui::FeedsDialog
36 |
37 |
38 | /**
39 | * @brief The FeedsDialog class
40 | */
41 | class FeedsDialog : public QDialog, private Ui::FeedsDialog
42 | {
43 | Q_OBJECT
44 |
45 | public:
46 | FeedsDialog(QWidget* parent, QSettings* settings);
47 | ~FeedsDialog();
48 |
49 | void setOptions(const FeedsOptions& options);
50 | FeedsOptions options();
51 |
52 | void loadSettings();
53 | void saveSettings(bool saveOptions = true);
54 |
55 | protected:
56 | bool eventFilter(QObject* obj, QEvent* ev);
57 |
58 | protected slots:
59 | void inputChanged();
60 |
61 | private slots:
62 | void computeButtonClicked();
63 | void computeVcButtonClicked();
64 | void setDefButton();
65 | void checkBoxChanged();
66 | void onFinished(int result);
67 |
68 | protected:
69 | QPointer mSettings;
70 | };
71 |
72 | #endif // FEEDSDIALOG_H
73 |
--------------------------------------------------------------------------------
/addons/src/feeds/feedsoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef FEEDSOPTIONS_H
21 | #define FEEDSOPTIONS_H
22 |
23 | class QSettings;
24 |
25 |
26 | struct FeedsOptions {
27 | FeedsOptions();
28 |
29 | bool useInch;
30 |
31 | struct InOut {
32 | bool in;
33 | double value;
34 | };
35 |
36 | InOut Vc; // cutting velosity
37 | InOut z; // number of tooth
38 | InOut Fz; // feed per tooth
39 | InOut diam;
40 | InOut speed;
41 | InOut feed;
42 |
43 | void load(QSettings* settings);
44 | void save(QSettings* settings);
45 | };
46 |
47 | #endif // FEEDSOPTIONS_H
48 |
--------------------------------------------------------------------------------
/addons/src/i2m/addons-i2m.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for QString
22 | #include // for QWidget
23 |
24 | #include "addons-i2m.h"
25 | #include "i2mdialog.h" // for I2MDialog
26 |
27 |
28 | void Addons::doI2M(QWidget* parent, QSettings* settings)
29 | {
30 | QString key = "DI2MDialog";
31 | I2MDialog* dlg;
32 | dlg = parent->findChild(key);
33 |
34 | if (!dlg) {
35 | dlg = new I2MDialog(parent, settings);
36 | dlg->setObjectName(key);
37 | dlg->loadSettings();
38 | }
39 |
40 | dlg->show();
41 | }
42 |
--------------------------------------------------------------------------------
/addons/src/i2m/addons-i2m.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_I2M_H
21 | #define ADDONS_I2M_H
22 |
23 | class QSettings;
24 | class QWidget;
25 |
26 |
27 | namespace Addons {
28 | void doI2M(QWidget* parent, QSettings* settings);
29 | }
30 |
31 | #endif // ADDONS_I2M_H
32 |
--------------------------------------------------------------------------------
/addons/src/i2m/i2m.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-i2m.h
2 | SOURCES += $$PWD/addons-i2m.cpp
3 |
4 | HEADERS += $$PWD/i2moptions.h
5 | SOURCES += $$PWD/i2moptions.cpp
6 |
7 | HEADERS += $$PWD/i2mdialog.h
8 | SOURCES += $$PWD/i2mdialog.cpp
9 | FORMS += $$PWD/i2mdialog.ui
10 |
--------------------------------------------------------------------------------
/addons/src/i2m/i2mdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef I2MDIALOG_H
22 | #define I2MDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for Q_OBJECT, slots
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QSettings;
30 | class QWidget;
31 |
32 | struct I2MOptions;
33 |
34 | #include "ui_i2mdialog.h" // for Ui::I2MDialog
35 |
36 |
37 | /**
38 | * @brief The I2MDialog class
39 | */
40 | class I2MDialog : public QDialog, private Ui::I2MDialog
41 | {
42 | Q_OBJECT
43 |
44 | public:
45 | I2MDialog(QWidget* parent, QSettings* settings);
46 | ~I2MDialog();
47 |
48 | void setOptions(const I2MOptions& options);
49 | I2MOptions options();
50 |
51 | void loadSettings();
52 | void saveSettings(bool saveOptions = true);
53 |
54 | protected slots:
55 | void inputChanged();
56 | void checkBoxToggled();
57 |
58 | private slots:
59 | void onFinished(int result);
60 |
61 | protected:
62 | QPointer mSettings;
63 | };
64 |
65 | #endif // I2MDIALOG_H
66 |
--------------------------------------------------------------------------------
/addons/src/i2m/i2moptions.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for QSettings
21 | #include // for QVariant
22 |
23 | #include "i2moptions.h"
24 |
25 |
26 | #define CFG_KEY_INCH_VALUE "inch"
27 | #define CFG_KEY_INCH_IN "inchIn"
28 | #define CFG_KEY_MM_VALUE "mm"
29 | #define CFG_KEY_MM_IN "mmIn"
30 | #define CFG_KEY_TO_INCH "ToInch"
31 |
32 |
33 | I2MOptions::I2MOptions() :
34 | toInch{true},
35 | mm{true, 100.0},
36 | inch{false, 0.0}
37 | {
38 | }
39 |
40 | void I2MOptions::load(QSettings* settings)
41 | {
42 | inch.value = settings->value(CFG_KEY_INCH_VALUE, inch.value).toDouble();
43 | inch.in = settings->value(CFG_KEY_INCH_IN, inch.in).toBool();
44 | mm.value = settings->value(CFG_KEY_MM_VALUE, mm.value).toDouble();
45 | mm.in = settings->value(CFG_KEY_MM_IN, mm.in).toBool();
46 | toInch = settings->value(CFG_KEY_TO_INCH, toInch).toBool();
47 | }
48 |
49 | void I2MOptions::save(QSettings* settings)
50 | {
51 | settings->setValue(CFG_KEY_INCH_VALUE, inch.value);
52 | settings->setValue(CFG_KEY_INCH_IN, inch.in);
53 | settings->setValue(CFG_KEY_MM_VALUE, mm.value);
54 | settings->setValue(CFG_KEY_MM_IN, mm.in);
55 | settings->setValue(CFG_KEY_TO_INCH, toInch);
56 | }
57 |
--------------------------------------------------------------------------------
/addons/src/i2m/i2moptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef I2MOPTIONS_H
21 | #define I2MOPTIONS_H
22 |
23 | class QSettings;
24 |
25 |
26 | struct I2MOptions {
27 | I2MOptions();
28 |
29 | bool toInch;
30 |
31 | struct InOut {
32 | bool in;
33 | double value;
34 | };
35 |
36 | InOut mm;
37 | InOut inch;
38 |
39 | void load(QSettings* settings);
40 | void save(QSettings* settings);
41 | };
42 |
43 | #endif // I2MOPTIONS_H
44 |
--------------------------------------------------------------------------------
/addons/src/i2mprog/addons-i2mprog.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for function
22 |
23 | #include // for QCoreApplication
24 | #include // for QDialog
25 | #include // for QString
26 | #include // for QWidget
27 |
28 | #include // for LongJobHelper, LongJobHelper::CANCEL
29 |
30 | #include "addons-i2mprog.h"
31 | #include "i2mprogdialog.h" // for I2MProgDialog
32 | #include "i2mprogoptions.h" // for I2MProgOptions
33 | #include "utils-i2mprog.h" // for i2mprog
34 |
35 |
36 | int Addons::doI2MProg(QWidget* parent, QSettings* settings, QString& tx)
37 | {
38 | int result = 0;
39 | QString key = "I2MProgDialog";
40 | I2MProgDialog* dlg;
41 | dlg = parent->findChild(key);
42 |
43 | if (!dlg) {
44 | dlg = new I2MProgDialog(parent, settings);
45 | dlg->setObjectName(key);
46 | dlg->loadSettings();
47 | }
48 |
49 | if (dlg->exec() != QDialog::Accepted) {
50 | return 0;
51 | }
52 |
53 | LongJobHelper helper{parent};
54 | helper.begin(tx.length(), QCoreApplication::translate("Addons::Actions", "Converting inch to metric"), 20);
55 |
56 | I2MProgOptions opt = dlg->options();
57 | result = Utils::i2mprog(tx, opt.axes, opt.toInch, opt.prec, [&helper](int pos) -> bool{
58 | return helper.check(pos) == LongJobHelper::CANCEL;
59 | });
60 |
61 | helper.end();
62 | dlg->deleteLater();
63 | return result;
64 | }
65 |
--------------------------------------------------------------------------------
/addons/src/i2mprog/addons-i2mprog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_I2MPROG_H
21 | #define ADDONS_I2MPROG_H
22 |
23 | class QSettings;
24 | class QString;
25 | class QWidget;
26 |
27 |
28 | namespace Addons {
29 | int doI2MProg(QWidget* parent, QSettings* settings, QString& tx);
30 | }
31 |
32 | #endif // ADDONS_I2MPROG_H
33 |
--------------------------------------------------------------------------------
/addons/src/i2mprog/i2mprog.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-i2mprog.h
2 | SOURCES += $$PWD/addons-i2mprog.cpp
3 |
4 | HEADERS += $$PWD/i2mprogoptions.h
5 | SOURCES += $$PWD/i2mprogoptions.cpp
6 |
7 | HEADERS += $$PWD/i2mprogdialog.h
8 | SOURCES += $$PWD/i2mprogdialog.cpp
9 | FORMS += $$PWD/i2mprogdialog.ui
10 |
11 | HEADERS += $$PWD/utils-i2mprog.h
12 | SOURCES += $$PWD/utils-i2mprog.cpp
13 |
--------------------------------------------------------------------------------
/addons/src/i2mprog/i2mprogdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef I2MPROGDIALOG_H
22 | #define I2MPROGDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for Q_OBJECT, slots
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QSettings;
30 | class QWidget;
31 |
32 | struct I2MProgOptions;
33 |
34 | #include "ui_i2mprogdialog.h" // for Ui::I2MProgDialog
35 |
36 |
37 | /**
38 | * @brief The I2MProgDialog class
39 | */
40 | class I2MProgDialog : public QDialog, private Ui::I2MProgDialog
41 | {
42 | Q_OBJECT
43 |
44 | public:
45 | I2MProgDialog(QWidget* parent, QSettings* settings);
46 | ~I2MProgDialog();
47 |
48 | void setOptions(const I2MProgOptions& options);
49 | I2MProgOptions options();
50 |
51 | void loadSettings();
52 | void saveSettings(bool saveOptions = true);
53 |
54 | private slots:
55 | void inputChanged();
56 | void onFinished(int result);
57 |
58 | protected:
59 | QPointer mSettings;
60 | };
61 |
62 | #endif // I2MPROGDIALOG_H
63 |
--------------------------------------------------------------------------------
/addons/src/i2mprog/i2mprogoptions.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for QSettings
21 | #include // for QVariant
22 |
23 | #include "i2mprogoptions.h"
24 |
25 |
26 | #define CFG_KEY_AXES "Axes"
27 | #define CFG_KEY_PRECISION "Precision"
28 | #define CFG_KEY_TO_INCH "ToInch"
29 |
30 |
31 | I2MProgOptions::I2MProgOptions() :
32 | toInch{false},
33 | prec{3},
34 | axes{"XYZUVW"}
35 | {
36 | }
37 |
38 | void I2MProgOptions::load(QSettings* settings)
39 | {
40 | axes = settings->value(CFG_KEY_AXES, axes).toString();
41 | prec = settings->value(CFG_KEY_PRECISION, prec).toInt();
42 | toInch = settings->value(CFG_KEY_TO_INCH, toInch).toBool();
43 | }
44 |
45 | void I2MProgOptions::save(QSettings* settings)
46 | {
47 | settings->setValue(CFG_KEY_AXES, axes);
48 | settings->setValue(CFG_KEY_PRECISION, prec);
49 | settings->setValue(CFG_KEY_TO_INCH, toInch);
50 | }
51 |
--------------------------------------------------------------------------------
/addons/src/i2mprog/i2mprogoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef I2MPROGOPTIONS_H
21 | #define I2MPROGOPTIONS_H
22 |
23 | #include // for QString
24 |
25 | class QSettings;
26 |
27 |
28 | struct I2MProgOptions {
29 | I2MProgOptions();
30 |
31 | bool toInch;
32 | int prec;
33 | QString axes;
34 |
35 | void load(QSettings* settings);
36 | void save(QSettings* settings);
37 | };
38 |
39 | #endif // I2MPROGOPTIONS_H
40 |
--------------------------------------------------------------------------------
/addons/src/i2mprog/utils-i2mprog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef UTILS_I2M_H
22 | #define UTILS_I2M_H
23 |
24 | #include // for function
25 |
26 | class QString;
27 |
28 |
29 | namespace Utils {
30 | int i2mprog(QString& tx,
31 | const QString& addr,
32 | bool toInch, int prec,
33 | const std::function& interrupt);
34 | }
35 |
36 | #endif // UTILS_I2M_H
37 |
--------------------------------------------------------------------------------
/addons/src/renumber/addons-renumber.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for function
22 |
23 | #include // for translate
24 | #include // for QDialog
25 | #include // for QString
26 | #include // for QWidget
27 |
28 | #include // for LongJobHelper, LongJobHelper::CANCEL
29 |
30 | #include "addons-renumber.h"
31 | #include "renumberdialog.h" // for RenumberDialog
32 | #include "renumberoptions.h" // for RenumberOptions
33 | #include "utils-renumber.h" // for renumber
34 |
35 |
36 | bool Addons::doRenumber(QWidget* parent, QSettings* settings, QString& tx)
37 | {
38 | QString key = "RenumberDialog";
39 | RenumberDialog* dlg;
40 | dlg = parent->findChild(key);
41 |
42 | if (!dlg) {
43 | dlg = new RenumberDialog(parent, settings);
44 | dlg->setObjectName(key);
45 | dlg->loadSettings();
46 | }
47 |
48 | if (dlg->exec() != QDialog::Accepted) {
49 | return false;
50 | }
51 |
52 | LongJobHelper helper{parent};
53 | helper.begin(tx.length(), QCoreApplication::translate("Addons::Actions", "Renumbering"), 20);
54 |
55 | bool changed = Utils::renumber(tx, dlg->options(), [&helper](int pos) -> bool{
56 | return helper.check(pos) == LongJobHelper::CANCEL;
57 | });
58 |
59 | helper.end();
60 | return changed;
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/addons/src/renumber/addons-renumber.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_RENUMBER_H
21 | #define ADDONS_RENUMBER_H
22 |
23 | class QSettings;
24 | class QString;
25 | class QWidget;
26 |
27 |
28 | namespace Addons {
29 | bool doRenumber(QWidget* parent, QSettings* settings, QString& tx);
30 | }
31 |
32 | #endif // ADDONS_RENUMBER_H
33 |
--------------------------------------------------------------------------------
/addons/src/renumber/renumber.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-renumber.h
2 | SOURCES += $$PWD/addons-renumber.cpp
3 |
4 | HEADERS += $$PWD/renumberoptions.h
5 | SOURCES += $$PWD/renumberoptions.cpp
6 |
7 | HEADERS += $$PWD/renumberdialog.h
8 | SOURCES += $$PWD/renumberdialog.cpp
9 | FORMS += $$PWD/renumberdialog.ui
10 |
11 | HEADERS += $$PWD/utils-renumber.h
12 | SOURCES += $$PWD/utils-renumber.cpp
13 |
--------------------------------------------------------------------------------
/addons/src/renumber/renumberdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef RENUMBERDIALOG_H
22 | #define RENUMBERDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for slots, Q_OBJECT
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QSettings;
30 | class QWidget;
31 |
32 | struct RenumberOptions;
33 |
34 | #include "ui_renumberdialog.h" // for Ui::RenumberDialog
35 |
36 |
37 | /**
38 | * @brief The RenumberDialog class
39 | */
40 | class RenumberDialog : public QDialog, private Ui::RenumberDialog
41 | {
42 | Q_OBJECT
43 |
44 | public:
45 | RenumberDialog(QWidget* parent, QSettings* settings);
46 | ~RenumberDialog();
47 |
48 | void setOptions(const RenumberOptions& options);
49 | RenumberOptions options();
50 |
51 | void loadSettings();
52 | void saveSettings(bool saveOptions = true);
53 |
54 | private slots:
55 | void atEndClicked();
56 | void divideClicked();
57 | void renumClicked();
58 | void allLinesClicked();
59 | void removeAllClicked();
60 | void mRenumHeClicked();
61 | void onFinished(int result);
62 |
63 | protected:
64 | QPointer mSettings;
65 | };
66 |
67 | #endif // RENUMBERDIALOG_H
68 |
--------------------------------------------------------------------------------
/addons/src/renumber/renumberoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef RENUMBEROPTIONS_H
21 | #define RENUMBEROPTIONS_H
22 |
23 | class QSettings;
24 |
25 |
26 | struct RenumberOptions {
27 | RenumberOptions();
28 |
29 | enum RenumberMode {
30 | RenumberWithN,
31 | RenumberAll,
32 | RemoveAll,
33 | RenumberWithoutN
34 | };
35 |
36 | int mode;
37 | int from;
38 | int to;
39 | int startAt;
40 | int inc;
41 | int width;
42 | bool applyWidth;
43 | bool renumEmpty;
44 | bool renumComm;
45 | bool renumMarked;
46 | bool keepExisting;
47 |
48 | void load(QSettings* settings);
49 | void save(QSettings* settings);
50 | };
51 |
52 | #endif // RENUMBEROPTIONS_H
53 |
--------------------------------------------------------------------------------
/addons/src/renumber/utils-renumber.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_REMOVEBYREGEX_H
21 | #define UTILS_REMOVEBYREGEX_H
22 |
23 | #include // for function
24 |
25 | class QString;
26 |
27 | struct RenumberOptions;
28 |
29 |
30 | namespace Utils {
31 |
32 | bool renumber(QString& text, const RenumberOptions& opt, const std::function& interrupt);
33 | bool renumberWithoutN(QString& line, int num, int width, bool renumAll);
34 | bool renumberWithN(QString& line, int num, int width, int from, int to, bool renumMarked);
35 | bool renumberAll(QString& line, int num, int width, bool renumEmpty, bool renumComm, bool keepExisting);
36 | bool renumberRemoveAll(QString& line, bool removeMarked);
37 |
38 | void insertNWord(QString& line, int num, int width);
39 |
40 | } // namespace Utils
41 |
42 | #endif // UTILSREMOVEBY_REGEX_H
43 |
--------------------------------------------------------------------------------
/addons/src/spaces/spaces.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/utils-spaces.h
2 | SOURCES += $$PWD/utils-spaces.cpp
3 |
--------------------------------------------------------------------------------
/addons/src/spaces/utils-spaces.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_SPACES_H
21 | #define UTILS_SPACES_H
22 |
23 | #include // for function
24 |
25 | class QString;
26 |
27 |
28 | namespace Utils {
29 | int removeSpaces(QString& tx, std::function interrupt);
30 | int insertSpaces(QString& tx, std::function interrupt);
31 | }
32 |
33 | #endif // UTILS_SPACES_H
34 |
--------------------------------------------------------------------------------
/addons/src/swapaxes/addons-swapaxes.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for function
22 |
23 | #include // for QDialog, QDialog::Accepted
24 | #include // for QString
25 | #include // for QWidget
26 |
27 | #include // for LongJobHelper, LongJobHelper::CANCEL
28 |
29 | #include "addons-swapaxes.h"
30 | #include "swapaxesdialog.h" // for SwapAxesDialog
31 | #include "swapaxesoptions.h" // for SwapAxesOptions
32 | #include "utils-swapaxes.h" // for swapAxes, COMMENT_ID_UNKNOWN
33 |
34 |
35 | bool Addons::doSwapAxes(QWidget* parent, QSettings* settings, QString& text)
36 | {
37 | QString key = "SwapAxesDialog";
38 | SwapAxesDialog* dlg;
39 | dlg = parent->findChild(key);
40 |
41 | if (!dlg) {
42 | dlg = new SwapAxesDialog(parent, settings);
43 | dlg->setObjectName(key);
44 | dlg->loadSettings();
45 | }
46 |
47 | if (dlg->exec() != QDialog::Accepted) {
48 | return false;
49 | }
50 |
51 |
52 | LongJobHelper helper{parent};
53 | helper.begin(text.length(), QCoreApplication::translate("Addons::Actions", "Axis exchange"), 20);
54 |
55 | bool changed = Utils::swapAxes(text, dlg->options(), [&helper](int pos) -> bool{
56 | return helper.check(pos) == LongJobHelper::CANCEL;
57 | });
58 |
59 | helper.end();
60 | dlg->deleteLater();
61 | return changed;
62 | }
63 |
--------------------------------------------------------------------------------
/addons/src/swapaxes/addons-swapaxes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_SWAPAXES_H
21 | #define ADDONS_SWAPAXES_H
22 |
23 | class QSettings;
24 | class QString;
25 | class QWidget;
26 |
27 |
28 | namespace Addons {
29 | bool doSwapAxes(QWidget* parent, QSettings* settings, QString& text);
30 | }
31 |
32 | #endif // ADDONS_SWAPAXES_H
33 |
--------------------------------------------------------------------------------
/addons/src/swapaxes/swapaxes.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-swapaxes.h
2 | SOURCES += $$PWD/addons-swapaxes.cpp
3 |
4 | HEADERS += $$PWD/swapaxesoptions.h
5 | SOURCES += $$PWD/swapaxesoptions.cpp
6 |
7 | HEADERS += $$PWD/swapaxesdialog.h
8 | SOURCES += $$PWD/swapaxesdialog.cpp
9 | FORMS += $$PWD/swapaxesdialog.ui
10 |
11 | HEADERS += $$PWD/utils-swapaxes.h
12 | SOURCES += $$PWD/utils-swapaxes.cpp
13 |
--------------------------------------------------------------------------------
/addons/src/swapaxes/swapaxesdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef SWAPAXESDIALOG_H
22 | #define SWAPAXESDIALOG_H
23 |
24 | #include // for QDialog
25 | #include // for Q_OBJECT, slots
26 | #include // for QPointer
27 | #include // for QString
28 |
29 | class QSettings;
30 | class QWidget;
31 |
32 | struct SwapAxesOptions;
33 |
34 | #include "ui_swapaxesdialog.h" // for Ui::SwapAxesDialog
35 |
36 |
37 | class SwapAxesDialog : public QDialog, private Ui::SwapAxesDialog
38 | {
39 | Q_OBJECT
40 |
41 | public:
42 | explicit SwapAxesDialog(QWidget* parent, QSettings* settings);
43 | ~SwapAxesDialog();
44 |
45 | void setOptions(const SwapAxesOptions& options);
46 | SwapAxesOptions options();
47 |
48 | void loadSettings();
49 | void saveSettings(bool saveOptions = true);
50 |
51 | private slots:
52 | void betweenCheckBoxClicked(bool checked);
53 | void modifyCheckBoxClicked(bool checked);
54 | void precisionSpinBoxChanded(int val);
55 | void onFinished(int result);
56 |
57 | protected:
58 | QPointer mSettings;
59 | };
60 |
61 | #endif // SWAPAXESDIALOG_H
62 |
--------------------------------------------------------------------------------
/addons/src/swapaxes/swapaxesoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef SWAPAXESOPTIONS_H
21 | #define SWAPAXESOPTIONS_H
22 |
23 | #include // for QString
24 | #include // for QStringList
25 |
26 | class QSettings;
27 |
28 |
29 | struct SwapAxesOptions {
30 | SwapAxesOptions();
31 |
32 | QString from;
33 | QString to;
34 | int precision;
35 |
36 | QStringList fromList;
37 | QStringList toList;
38 |
39 | struct Limit {
40 | bool enable;
41 | double min;
42 | double max;
43 | } limit;
44 |
45 | enum Operation {
46 | Nop = -1,
47 | Add,
48 | Subtract,
49 | Multiply,
50 | Divide
51 | };
52 |
53 | struct Convert {
54 | bool enable;
55 | int operation;
56 | double value;
57 | } convert;
58 |
59 | void load(QSettings* settings);
60 | void save(QSettings* settings);
61 | };
62 |
63 | #endif // SWAPAXESOPTIONS_H
64 |
--------------------------------------------------------------------------------
/addons/src/swapaxes/utils-swapaxes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023-2025 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef UTILS_SWAPAXES_H
22 | #define UTILS_SWAPAXES_H
23 |
24 | #include // for function
25 |
26 | #include // for QString
27 |
28 | struct SwapAxesOptions;
29 |
30 |
31 | namespace Utils {
32 | bool swapAxes(QString& text, const SwapAxesOptions& opt, const std::function& interrupt);
33 |
34 | bool swapAxes(QString& text,
35 | const QString& textToFind,
36 | const QString& replacedText,
37 | bool checkBound,
38 | double min,
39 | double max,
40 | int oper,
41 | double modifier,
42 | int prec,
43 | const std::function& interrupt);
44 | }
45 |
46 | #endif // UTILS_SWAPAXES_H
47 |
--------------------------------------------------------------------------------
/addons/src/triangle/addons-triangle.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #include // for QString
22 | #include // for QWidget
23 |
24 | #include "addons-triangle.h"
25 | #include "triangledialog.h" // for TriangleDialog
26 |
27 |
28 | void Addons::doTriangle(QWidget* parent, QSettings* settings)
29 | {
30 | QString key = "TriangleDialog";
31 | TriangleDialog* dlg;
32 | dlg = parent->findChild(key);
33 |
34 | if (!dlg) {
35 | dlg = new TriangleDialog(parent, settings);
36 | dlg->setObjectName(key);
37 | dlg->loadSettings();
38 | }
39 |
40 | dlg->show();
41 | }
42 |
--------------------------------------------------------------------------------
/addons/src/triangle/addons-triangle.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef ADDONS_TRIANGLE_H
21 | #define ADDONS_TRIANGLE_H
22 |
23 | class QSettings;
24 | class QWidget;
25 |
26 |
27 | namespace Addons {
28 | void doTriangle(QWidget* parent, QSettings* settings);
29 | }
30 |
31 | #endif // ADDONS_TRIANGLE_H
32 |
--------------------------------------------------------------------------------
/addons/src/triangle/triangle.pri:
--------------------------------------------------------------------------------
1 | HEADERS += $$PWD/addons-triangle.h
2 | SOURCES += $$PWD/addons-triangle.cpp
3 |
4 | HEADERS += $$PWD/triangleoptions.h
5 | SOURCES += $$PWD/triangleoptions.cpp
6 |
7 | HEADERS += $$PWD/triangledialog.h
8 | SOURCES += $$PWD/triangledialog.cpp
9 | FORMS += $$PWD/triangledialog.ui
10 |
--------------------------------------------------------------------------------
/addons/src/triangle/triangleoptions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef TRIANGLEOPTIONS_H
21 | #define TRIANGLEOPTIONS_H
22 |
23 | class QSettings;
24 |
25 |
26 | struct TriangleOptions {
27 | TriangleOptions();
28 |
29 | bool rightTriangle;
30 |
31 | struct InOut {
32 | bool in;
33 | double value;
34 | };
35 |
36 | InOut angleA;
37 | InOut angleB;
38 | InOut angleC;
39 | InOut sideA;
40 | InOut sideB;
41 | InOut sideC;
42 |
43 | void load(QSettings* settings);
44 | void save(QSettings* settings);
45 | };
46 |
47 | #endif // TRIANGLEOPTIONS_H
48 |
--------------------------------------------------------------------------------
/doc/SerialTransmission_Help.odt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/doc/SerialTransmission_Help.odt
--------------------------------------------------------------------------------
/examples/0100.nc:
--------------------------------------------------------------------------------
1 | %
2 | :0100( FLANGE OP.2 )
3 | ( DRG. 12345 )
4 | ( 2015-06-26 )
5 | (TOOLTIPS FROM cnc_tips.txt)
6 | #501=350.(FLANGE DIA.)
7 | #502=-23(FLANGE CLEARENCE DEPTH)
8 | #503=-5(FLANGE FACE)
9 | #504=250(SPIGOT DIA)
10 | #505=0(DATUM/SPIGOT FACE)
11 | #506=214(SPIGOT ID CLEARENCE)
12 | #507=120(SHAFT OD CLEARENCE)
13 | #508=-8.0(SHAFT FACE)
14 | #509=45.15(SHAFT DIA)
15 | (****************************************)
16 | N1G0X380.Z300.T0101M16
17 | G0G96X[#501]Z[#505+50.]S250M3M8(ROUGH SPIGOT)
18 | M7
19 | Z[#505]
20 | G1Z[#502]F0.35
21 | G0X[#501+2.]Z[#503+2.]
22 | G1X[#504+6.]F.3
23 | G0X[#504+8.]Z[#505+2.]
24 | G1X[#506]
25 | G0X[#501+2.]Z[#505+3.]
26 | Z[#503-2.]
27 | G1U-4.6Z[#503+.3]F0.2
28 | X[#504+6.]F0.3
29 | G0X[#504+8.]Z[#505+0.3]
30 | G1X[#506]
31 | G0X[#504+3.]Z[#505+1.]
32 | G1Z[#503+0.3]
33 | X[#504+6.]F0.35
34 | G0Z[#505+1.]
35 | X[#504+0.5]
36 | G1Z[#503+0.3]F0.3
37 | X[#504+3.]F0.35
38 | G0Z200.
39 | M01
40 | N5G0Z200.T0505M16
41 | G96X[#509-1]Z[#505+50]S250M3M8(SHAFT FACE)
42 | Z[#508+2.]
43 | G1X[#507]F0.25
44 | G0X[#509+2.6]Z[#508+3.]
45 | G1Z[#508+0.5]F.2
46 | G1X[#509]W-1.3F.15
47 | G0X[#509-1.]Z[#508]
48 | G1X[#507]F.2
49 | G0Z[#505+5.]
50 | G0Z200.M9
51 | M1
52 | N3G0Z200.T0303M16
53 | G96X[#501+2.]Z[#505+50.]S280M3M8(FINISH SPIGOT)
54 | Z[#503-2.]
55 | G1U-4.Z[#503]F0.18
56 | X[#504+0.5]
57 | G0X[#504+.7]Z[#505-2.5]
58 | G1U1.4Z[#505]F.15
59 | X[#506]F.2
60 | G0X[#504]Z[#505+1.]
61 | G1Z[#503-.1]F.15
62 | G4P200
63 | G0X400.Z300.M9
64 | G97S1200
65 | G04P2000
66 | S150
67 | M26
68 | G4P6000
69 | M27
70 | M5
71 | M30
72 | %
73 |
--------------------------------------------------------------------------------
/examples/FANUC0M.nc:
--------------------------------------------------------------------------------
1 | %
2 | :0097
3 | ( FANUC 0M)
4 | ( 10.01.2010 )
5 | ( LOAD T3 - S580 )
6 | N10 G55 G40 G0 X2. Y0 M3
7 | N20 G43 H3 Z39. M8
8 | N30 G1 Z29.88 F39
9 | N40 X-114. F117
10 | N50 G42 H19 Y10. F39
11 | N60 X11. F117
12 | N70 Y-10.
13 | N80 X-114.
14 | N90 G2 X-114. Y10. R10. F39
15 | N100 G0 G40 Y0
16 | N110 G28 Z39. M5
17 | N120 G0 Y-49. M9
18 | N130 M0
19 | ( LOAD T5 - S350 )
20 | N140 G0 G40 X-910. Y0. M3
21 | N150 G43 H5 Z54. M8
22 | N160 G1 Z42.46 F25
23 | N170 X-939. F73
24 | N180 G28 Z54. M5
25 | N190 M20
26 | N200 M20
27 | N210 G0 G40 X-800. Y2.40 M3
28 | N220 G43 H5 Z54. M8
29 | N230 G1 Z43.75 F25
30 | N240 X-432. Y-2.40 F73
31 | N250 G28 Z54. M5
32 | N260 G0 X0 Y35. M9
33 | N270 M20
34 | N280 M20
35 | N290 M30
36 | %
37 |
--------------------------------------------------------------------------------
/examples/FANUC0T.nc:
--------------------------------------------------------------------------------
1 | %
2 | O0358 ( FANUC 0T )
3 | ( 10.01.2010 )
4 | N01G50S0600
5 | G00T0202
6 | M41
7 | G96S0450M03
8 | X86.
9 | Z0.25
10 | G01X118M08F0.3
11 | Z0.45
12 | G00X96.
13 | G01Z-51.4
14 | X95.6
15 | G00Z0.45
16 | X101.04
17 | G1Z-51.4
18 | X100.64
19 | G0Z1
20 | X104.5
21 | G1Z-51.4
22 | X104
23 | G0Z1
24 | X107.4
25 | G1Z-51.4
26 | X106M9
27 | G00Z220
28 | T0200
29 | N02G50S0600
30 | G00T0505
31 | M41
32 | G96S0450M03
33 | X97.04
34 | Z-45
35 | G01X118M08F0.3
36 | Z-46.45
37 | G0X100
38 | Z-43
39 | G1X100.64
40 | Z-44.45X102
41 | X118
42 | Z-45.5M09
43 | G00X97
44 | Z150.
45 | T0500
46 | N03G50S0600
47 | G00T0404
48 | M41
49 | G96S0450M03
50 | X106
51 | Z0.
52 | G01X118M08F.3
53 | Z.45
54 | G00X109.5
55 | G01Z0.166
56 | X107.91Z-1
57 | Z-46
58 | X105M09
59 | G00Z250
60 | T0400
61 | M01
62 | M05
63 | M30
64 | %
65 |
--------------------------------------------------------------------------------
/examples/HAAS.nc:
--------------------------------------------------------------------------------
1 | %
2 | O00094 ( HAAS )
3 | ( 10.01.2010 )
4 | N10 G17 G40 G21 G90
5 | N20 G10 L2 P1 X-269.39 Y-254.65 Z-689.
6 | N30 T5 M06 ( 19.1mm CHAMDRILL )
7 | N40 IF [ #5405 GE 6000 ] THEN #3000= 15 ( TOOL LIFE EXPIRED )
8 | N50 M88
9 | N60 S1500 M03
10 | N70 G00 G54 X5.25 Y0. T3
11 | N80 G43 Z50. H05 M08
12 | N90 G81 G98 Z-15. R5. F412
13 | N100 G00 G80 Z100. M89
14 | N110 T3 M06 ( 20mm 390 ENDMILL )
15 | N120 IF [#5403 GE 3600 ] THEN #3000= 15 ( TOOL LIFE EXPIRED )
16 | N130 M88
17 | N140 S3720 M03
18 | N150 G00 G54 X5.25 Y0. T4
19 | N160 G43 Z5. H03 M08
20 | N170 G01 Z-5. F200
21 | N180 G02 X5.25 Y0. I-5.25 J0. F1120
22 | N190 G01 Z-10. F200
23 | N200 G02 X5.25 Y0. I-5.25 J0. F1120
24 | N210 G00 G80 Z100. M89
25 | N220 T4 M06 ( ISO 1.5 THREAD MILL )
26 | N230 M88
27 | N240 S1869 M03
28 | N250 G00 G54 X0. Y0. T14
29 | N260 G43 Z5. H04 M08
30 | N270 G01 Z-12. F500
31 | N280 G01 X2.75 Y-2.75 G41 D04 F400
32 | N290 G03 X5.5 Y0. I0. J2.75 Z-11.813 F80
33 | N300 G03 X5.5 Y0. I-5.5 J0. Z-10.313
34 | N310 G03 X2.75 Y2.75 I-2.75 J0. Z-10.125
35 | N320 G01 G40 X0. Y0. F400
36 | N330 G00 G80 Z100. M89
37 | N340 G53 G00 Z0. M05
38 | N350 G53 X-508. Y0.
39 | N360 T24 M06
40 | N370 M30
41 | %
42 |
--------------------------------------------------------------------------------
/examples/HK.nc:
--------------------------------------------------------------------------------
1 | (OLD HECKLER&KOCH CONTROL )
2 | ( 10.01.2010 )
3 | P000058
4 | N10T25M75M60
5 | N20T25M6
6 | N30G54G0Z+0035000F20000S3120M13P32.936P32
7 | N40G89G81G2Z-0028000K+0000000R-0013000M13M8P120.0P121.0P122.178P123.22.5P125.-90P126.4
8 | N50G92X-0280000
9 | N60G89G2P120P121P122P123P125P126
10 | N70G80G0Z+0040000
11 | N80G92Y-0198000Z-0040000
12 | N90G81G0X+0000000Y+0000000Z-0037000R+0003000P32
13 | N100X+0280000
14 | N110G80G0G54Z+0040000
15 | N120G66Y+0500000
16 | N130T0M6M29M70
17 |
--------------------------------------------------------------------------------
/examples/SINUMERIK850.nc:
--------------------------------------------------------------------------------
1 | %MPF 90
2 | ( SINUMERIK 850 )
3 | ( 10.01.2010 )
4 | R11=384.553 R12=213.086 R13=83.5
5 | R21=519.265 R22=212.287 R23=-26.
6 | R31=429.816 R32=212.122 R33=-135.
7 | R41=999. R42=999. R43=999.
8 | L100 ( LOAD ZERO OFFSETS )
9 | N1 @371 R52 K2 K0
10 | N2 @122 R52 K0 K10
11 | N3 @100 K1350
12 | N10 G0 G17 G40 G53 G60 G68 G71 G80 G90 G94 Z631.600 D0
13 | N20 L6 T27 ( 8.5mm DRILL )
14 | N30 G54 B-270
15 | N40 G0 X-54. Y120. M40 S2995 M3 F599 T14 M8
16 | N50 G81 R2=8. R3=-38. R10=8. M52
17 | N60 Y-120.
18 | N70 X54.
19 | N80 Y120.
20 | N90 G0 G80 Z200.
21 | N100 G55 B-165 X236. Y152.5
22 | N110 G82 R2=5. R3=-28 R10=25.
23 | N120 Y-152.5
24 | N130 X-236. Y-151.
25 | N140 Y151.
26 | N150 G0 G80 Z200. M9
27 | N160 L65
28 | N170 L6 T14 ( 12mm DRILL )
29 | N180 G56 B180 X-100. Y100. M40 S2122 M3 F509 M8 T9
30 | N190 G82 R2=4. R3=-25. R10=50. M52
31 | N200 Y-100.
32 | N210 X100.
33 | N220 Y100.
34 | N230 G0 G80 Z250. M9
35 | N240 L65
36 | N250 L6 T9 ( DRILL )
37 | N260 G56 B180 X-130. Y9. M40 S1500 M3 F150 M8 T97
38 | N270 G81 R2=5. R3=-8. R10=5. M52
39 | N280 Y-9.
40 | N290 G0 G80 Z50.
41 | N300 X130. Y-36.
42 | N310 G81 R2=5. R3=-8. R10=5.
43 | N320 Y36.
44 | N330 G0 G80 Z250. M9
45 | N340 L6 T97 ( 2.5mm HSS DRILL )
46 | N350 G56 B180 X-130. Y9. M40 S3055 M3 F150 M8 T98
47 | N360 G81 R2=5. R3=-12. R10=5. M52
48 | N370 Y-9.
49 | N380 G0 G80 Z50.
50 | N390 X130. Y-36.
51 | N400 G81 R2=5. R3=-12. R10=5.
52 | N410 Y36.
53 | N420 G0 G80 Z250. M9
54 | N430 L6 T98 ( M3 HSS TAP )
55 | N440 G56 B180 X-130. Y9. M42 S955 M3 M8 T28
56 | N450 G84 R2=6. R3=-12. R9=0.5 R10=6. M52
57 | N460 Y-9.
58 | N470 G0 G80 Z50.
59 | N480 X130. Y-36.
60 | N490 G84 R2=6. R3=-12. R9=0.5 R10=6.
61 | N500 Y36.
62 | N510 G0 G80 Z250. M9
63 | N520 L6 T28 ( M10 TAP )
64 | N530 G55 B-165 X-236. Y151. S450 M42 M3 M8
65 | N540 G84 R2=6. R3=-26. R9=1.5 R10=25. M52
66 | N550 Y-151.
67 | N560 X236. Y-152.5
68 | N570 Y152.5
69 | N580 G0 G80 Z350.
70 | N590 G54 B270 X54. Y120.
71 | N600 G84 R2=10. R3=-30. R9=1.5 R10=10.
72 | N610 Y-120.
73 | N620 X-54.
74 | N630 Y120.
75 | N640 G0 G80 Z250. M9
76 | N650 L65
77 | N660 L12
78 | N670 M30
79 |
--------------------------------------------------------------------------------
/examples/cnc_tips.txt:
--------------------------------------------------------------------------------
1 | [FANUC]
2 | #501=#501 - flange dia.
3 | #502=#502 - flange clearence depth
4 | #503=#503 - flange face
5 | #504=#504 - spigot dia
6 | #505=#505 - datum/spigot face
7 | #506=#506 - spigot id clearence
8 | #507=#507 - shaft od clearence
9 | #508=#508 - shaft face
10 | #509=#509 - shaft dia
11 | T0101=T0101 - rough od
12 | T0303=T0303 - finish od
13 | T0505=T0505 - rough id
14 | [OKUMA]
15 | PRES=PRES - chuck pressure *** low:0 - high:1
16 | FLAN=FLAN - flange dia
17 | FLFA=FLFA - flange face
18 | SPIG=SPIG - spigot dia
19 | SPFA=SPFA - spigot face
20 | SPCL=SPCL - spigot id clearence dia
21 | CLCL=CLCL - bearing boss od clearence
22 | CLFA=CLFA - bearing boss face
23 | BDIA=BDIA - bearing dia
24 | BDFA=BDFA - bearing landing face
25 | GDIA=GDIA - grease cavity dia
26 | GRFA=GRFA - grease cavity face
27 | SHAF=SHAF - shaft dia
28 | SDIA=SDIA - oilseal dia
29 | SHFA=SHFA - oilseal face
30 | SHCL=SHCL - shaft depth clearence
31 | RAD1=RAD1 - rough grease cavity radius g76
32 |
--------------------------------------------------------------------------------
/gcodefileserver/gcodefileserver.pro:
--------------------------------------------------------------------------------
1 | # GCoderFileServer
2 |
3 | TEMPLATE = app
4 | TARGET = gcodefileserver
5 |
6 | QT *= widgets serialport network
7 | MODULES *= kdiff3 qtsingleapplication GCodeShared
8 |
9 | include(../common.pri)
10 |
11 | defined(VERSION, var) {
12 | # Define the version as a string literal
13 | # https://stackoverflow.com/a/2411008
14 | DEFINES += 'GCODEWORKSHOP_VERSION=\\"$$VERSION\\"'
15 | } else {
16 | VERSION = $$getVersion()
17 | }
18 |
19 | SOURCES = \
20 | filechecker.cpp \
21 | gcodefileserver.cpp \
22 | main.cpp
23 |
24 | HEADERS = \
25 | filechecker.h \
26 | gcodefileserver.h
27 |
28 | FORMS = \
29 | filechecker.ui \
30 | gcodefileserver.ui
31 |
32 |
33 | # target platforms dependencies
34 | #######################################
35 |
36 | unix {
37 | target.path = $${PREFIX}/bin
38 | INSTALLS += target
39 | }
40 |
41 | macx {
42 | }
43 |
44 | win32 {
45 | target.path = $${PREFIX}/bin
46 | INSTALLS += target
47 | QMAKE_TARGET_PRODUCT=GCodeFileServer
48 | }
49 |
50 | RC_ICONS = images/edytornc.ico images/edytornc48.ico
51 |
--------------------------------------------------------------------------------
/gcodefileserver/images/edytornc.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodefileserver/images/edytornc.ico
--------------------------------------------------------------------------------
/gcodefileserver/images/edytornc48.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodefileserver/images/edytornc48.ico
--------------------------------------------------------------------------------
/gcodeshared/gcodeshared.pro:
--------------------------------------------------------------------------------
1 |
2 | VERSION = 2018.07
3 | TEMPLATE = lib
4 | TARGET = gcodeshared
5 | CONFIG += staticlib
6 |
7 | QT *= widgets serialport network
8 | # QTextCodec in Qt6
9 | greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
10 |
11 | include(../common.pri)
12 |
13 | INCLUDEPATH += include
14 |
15 | # GCoderShared
16 |
17 | SOURCES += \
18 | serialporttestdialog.cpp \
19 | serialtransmissiondialog.cpp \
20 | serialportconfigdialog.cpp
21 |
22 | HEADERS += \
23 | include/version.h \
24 | serialportsettings.h \
25 | serialporttestdialog.h \
26 | serialtransmissiondialog.h \
27 | serialportconfigdialog.h \
28 | serialportsettings.h
29 |
30 | FORMS += \
31 | serialporttestdialog.ui \
32 | serialtransmissiondialog.ui \
33 | serialportconfigdialog.ui
34 |
35 |
36 | # utils
37 | #######################################
38 |
39 | HEADERS += include/ui/longjobhelper.h \
40 | include/utils/medium.h \
41 | include/utils/configpage.h \
42 | include/utils/configdialog.h \
43 | include/utils/gcode-converter.h \
44 | include/utils/guessfilename.h \
45 | include/utils/splitfile.h \
46 | utils/filepatterns.h
47 |
48 | SOURCES += ui/longjobhelper.cpp \
49 | utils/medium.cpp \
50 | utils/configpage.cpp \
51 | utils/configdialog.cpp \
52 | utils/gcode-converter.cpp \
53 | utils/guessfilename.cpp \
54 | utils/splitfile.cpp
55 |
56 | FORMS += utils/configdialog.ui
57 |
58 |
59 | # resources
60 | #######################################
61 |
62 | RESOURCES = application.qrc
63 |
--------------------------------------------------------------------------------
/gcodeshared/images/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/add.png
--------------------------------------------------------------------------------
/gcodeshared/images/application-x-g-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/application-x-g-code.png
--------------------------------------------------------------------------------
/gcodeshared/images/arrow-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/arrow-down.png
--------------------------------------------------------------------------------
/gcodeshared/images/arrow-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/arrow-left.png
--------------------------------------------------------------------------------
/gcodeshared/images/arrow-right-double.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/arrow-right-double.png
--------------------------------------------------------------------------------
/gcodeshared/images/arrow-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/arrow-right.png
--------------------------------------------------------------------------------
/gcodeshared/images/arrow-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/arrow-up.png
--------------------------------------------------------------------------------
/gcodeshared/images/attach.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/attach.png
--------------------------------------------------------------------------------
/gcodeshared/images/bhc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/bhc.png
--------------------------------------------------------------------------------
/gcodeshared/images/blockskip+.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/blockskip+.png
--------------------------------------------------------------------------------
/gcodeshared/images/blockskip-.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/blockskip-.png
--------------------------------------------------------------------------------
/gcodeshared/images/blockskip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/blockskip.png
--------------------------------------------------------------------------------
/gcodeshared/images/blockskipr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/blockskipr.png
--------------------------------------------------------------------------------
/gcodeshared/images/browse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/browse.png
--------------------------------------------------------------------------------
/gcodeshared/images/calc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/calc.png
--------------------------------------------------------------------------------
/gcodeshared/images/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/cancel.png
--------------------------------------------------------------------------------
/gcodeshared/images/cascade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/cascade.png
--------------------------------------------------------------------------------
/gcodeshared/images/chamfer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/chamfer.png
--------------------------------------------------------------------------------
/gcodeshared/images/chamfer_big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/chamfer_big.png
--------------------------------------------------------------------------------
/gcodeshared/images/cleanup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/cleanup.png
--------------------------------------------------------------------------------
/gcodeshared/images/clipboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/clipboard.png
--------------------------------------------------------------------------------
/gcodeshared/images/close_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/close_small.png
--------------------------------------------------------------------------------
/gcodeshared/images/compfile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/compfile.png
--------------------------------------------------------------------------------
/gcodeshared/images/configure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/configure.png
--------------------------------------------------------------------------------
/gcodeshared/images/connect_creating.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/connect_creating.png
--------------------------------------------------------------------------------
/gcodeshared/images/connect_established.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/connect_established.png
--------------------------------------------------------------------------------
/gcodeshared/images/connect_no.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/connect_no.png
--------------------------------------------------------------------------------
/gcodeshared/images/copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/copy.png
--------------------------------------------------------------------------------
/gcodeshared/images/deattach.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/deattach.png
--------------------------------------------------------------------------------
/gcodeshared/images/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/default.png
--------------------------------------------------------------------------------
/gcodeshared/images/diff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/diff.png
--------------------------------------------------------------------------------
/gcodeshared/images/diff_editor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/diff_editor.png
--------------------------------------------------------------------------------
/gcodeshared/images/diffl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/diffl.png
--------------------------------------------------------------------------------
/gcodeshared/images/diffr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/diffr.png
--------------------------------------------------------------------------------
/gcodeshared/images/document-open-recent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/document-open-recent.png
--------------------------------------------------------------------------------
/gcodeshared/images/document-print-preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/document-print-preview.png
--------------------------------------------------------------------------------
/gcodeshared/images/document-print.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/document-print.png
--------------------------------------------------------------------------------
/gcodeshared/images/dots.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/dots.png
--------------------------------------------------------------------------------
/gcodeshared/images/edit-find.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/edit-find.png
--------------------------------------------------------------------------------
/gcodeshared/images/edit-select-all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/edit-select-all.png
--------------------------------------------------------------------------------
/gcodeshared/images/editcopy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/editcopy.png
--------------------------------------------------------------------------------
/gcodeshared/images/editcut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/editcut.png
--------------------------------------------------------------------------------
/gcodeshared/images/editdelete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/editdelete.png
--------------------------------------------------------------------------------
/gcodeshared/images/editpaste.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/editpaste.png
--------------------------------------------------------------------------------
/gcodeshared/images/edytornc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/edytornc.png
--------------------------------------------------------------------------------
/gcodeshared/images/edytornc48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/edytornc48.png
--------------------------------------------------------------------------------
/gcodeshared/images/exit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/exit.png
--------------------------------------------------------------------------------
/gcodeshared/images/fileclose.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/fileclose.png
--------------------------------------------------------------------------------
/gcodeshared/images/fileclose_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/fileclose_small.png
--------------------------------------------------------------------------------
/gcodeshared/images/filefind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/filefind.png
--------------------------------------------------------------------------------
/gcodeshared/images/filenew.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/filenew.png
--------------------------------------------------------------------------------
/gcodeshared/images/fileopen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/fileopen.png
--------------------------------------------------------------------------------
/gcodeshared/images/filesave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/filesave.png
--------------------------------------------------------------------------------
/gcodeshared/images/filesaveall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/filesaveall.png
--------------------------------------------------------------------------------
/gcodeshared/images/filesaveas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/filesaveas.png
--------------------------------------------------------------------------------
/gcodeshared/images/find.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/find.png
--------------------------------------------------------------------------------
/gcodeshared/images/findinfiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/findinfiles.png
--------------------------------------------------------------------------------
/gcodeshared/images/findnext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/findnext.png
--------------------------------------------------------------------------------
/gcodeshared/images/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/folder.png
--------------------------------------------------------------------------------
/gcodeshared/images/funct.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/funct.png
--------------------------------------------------------------------------------
/gcodeshared/images/go-next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/go-next.png
--------------------------------------------------------------------------------
/gcodeshared/images/go-previous.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/go-previous.png
--------------------------------------------------------------------------------
/gcodeshared/images/hide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/hide.png
--------------------------------------------------------------------------------
/gcodeshared/images/i2m.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/i2m.png
--------------------------------------------------------------------------------
/gcodeshared/images/i2mprog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/i2mprog.png
--------------------------------------------------------------------------------
/gcodeshared/images/inlinecalc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/inlinecalc.png
--------------------------------------------------------------------------------
/gcodeshared/images/insertemptylines.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/insertemptylines.png
--------------------------------------------------------------------------------
/gcodeshared/images/insertspc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/insertspc.png
--------------------------------------------------------------------------------
/gcodeshared/images/led.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/led.png
--------------------------------------------------------------------------------
/gcodeshared/images/list-remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/list-remove.png
--------------------------------------------------------------------------------
/gcodeshared/images/lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/lock.png
--------------------------------------------------------------------------------
/gcodeshared/images/ncfile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/ncfile.png
--------------------------------------------------------------------------------
/gcodeshared/images/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/new.png
--------------------------------------------------------------------------------
/gcodeshared/images/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/ok.png
--------------------------------------------------------------------------------
/gcodeshared/images/open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/open.png
--------------------------------------------------------------------------------
/gcodeshared/images/paracomment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/paracomment.png
--------------------------------------------------------------------------------
/gcodeshared/images/project_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/project_add.png
--------------------------------------------------------------------------------
/gcodeshared/images/project_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/project_new.png
--------------------------------------------------------------------------------
/gcodeshared/images/project_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/project_open.png
--------------------------------------------------------------------------------
/gcodeshared/images/project_remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/project_remove.png
--------------------------------------------------------------------------------
/gcodeshared/images/project_save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/project_save.png
--------------------------------------------------------------------------------
/gcodeshared/images/project_save_as.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/project_save_as.png
--------------------------------------------------------------------------------
/gcodeshared/images/receive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/receive.png
--------------------------------------------------------------------------------
/gcodeshared/images/redo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/redo.png
--------------------------------------------------------------------------------
/gcodeshared/images/removeemptylines.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/removeemptylines.png
--------------------------------------------------------------------------------
/gcodeshared/images/removespc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/removespc.png
--------------------------------------------------------------------------------
/gcodeshared/images/renumber.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/renumber.png
--------------------------------------------------------------------------------
/gcodeshared/images/replace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/replace.png
--------------------------------------------------------------------------------
/gcodeshared/images/reset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/reset.png
--------------------------------------------------------------------------------
/gcodeshared/images/semicomment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/semicomment.png
--------------------------------------------------------------------------------
/gcodeshared/images/send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/send.png
--------------------------------------------------------------------------------
/gcodeshared/images/serial.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/serial.png
--------------------------------------------------------------------------------
/gcodeshared/images/serialconfig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/serialconfig.png
--------------------------------------------------------------------------------
/gcodeshared/images/serialtest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/serialtest.png
--------------------------------------------------------------------------------
/gcodeshared/images/show_side_panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/show_side_panel.png
--------------------------------------------------------------------------------
/gcodeshared/images/split_prog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/split_prog.png
--------------------------------------------------------------------------------
/gcodeshared/images/spserver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/spserver.png
--------------------------------------------------------------------------------
/gcodeshared/images/start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/start.png
--------------------------------------------------------------------------------
/gcodeshared/images/stop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/stop.png
--------------------------------------------------------------------------------
/gcodeshared/images/swapaxes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/swapaxes.png
--------------------------------------------------------------------------------
/gcodeshared/images/tile_h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/tile_h.png
--------------------------------------------------------------------------------
/gcodeshared/images/tile_v.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/tile_v.png
--------------------------------------------------------------------------------
/gcodeshared/images/triangles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/triangles.png
--------------------------------------------------------------------------------
/gcodeshared/images/trig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/trig.png
--------------------------------------------------------------------------------
/gcodeshared/images/trig1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/trig1.png
--------------------------------------------------------------------------------
/gcodeshared/images/txtfile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/txtfile.png
--------------------------------------------------------------------------------
/gcodeshared/images/undo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/undo.png
--------------------------------------------------------------------------------
/gcodeshared/images/unlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/unlock.png
--------------------------------------------------------------------------------
/gcodeshared/images/vcf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/vcf.png
--------------------------------------------------------------------------------
/gcodeshared/images/window-close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/window-close.png
--------------------------------------------------------------------------------
/gcodeshared/images/zoom-in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/zoom-in.png
--------------------------------------------------------------------------------
/gcodeshared/images/zoom-out.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeshared/images/zoom-out.png
--------------------------------------------------------------------------------
/gcodeshared/include/utils/gcode-converter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2025 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_GCODE_CONVERTER_H
21 | #define UTILS_GCODE_CONVERTER_H
22 |
23 | #include // for QByteArray
24 |
25 | class QSettings;
26 | class QString;
27 |
28 |
29 | namespace GCode {
30 |
31 | struct Converter {
32 | Converter();
33 |
34 | QString fromRawData(const QByteArray& data) const;
35 | QByteArray toRawData(const QString& text) const;
36 |
37 | struct Options {
38 | QByteArray codecName = QByteArray{};
39 | // When loading files, discard "extra" empty lines.
40 | bool dropEmptyLine = true;
41 | // When loading files, discard the upper 128 code points commonly used for national alphabets.
42 | bool dropExtented = false;
43 | // When loading files, discard control characters (0x00-0x1f) other than '\n' and '\r'.
44 | bool dropControll = true;
45 |
46 | void load(QSettings* settings);
47 | void save(QSettings* settings);
48 | };
49 |
50 | Options options;
51 |
52 | static Options defaultOptions();
53 | static void setDefaultOptions(const Options& options);
54 | };
55 |
56 | } // namespace GCode
57 |
58 | #endif // UTILS_GCODE_CONVERTER_H
59 |
--------------------------------------------------------------------------------
/gcodeshared/include/utils/guessfilename.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef UTILS_GUESSFILENAME_H
21 | #define UTILS_GUESSFILENAME_H
22 |
23 | #include // for QString
24 |
25 |
26 | namespace Utils {
27 | struct FileExt {
28 | QString name;
29 | QString ext;
30 | };
31 |
32 | FileExt guessFileNameByProgNum(const QString& text);
33 | QString guessFileNameByComments(const QString& text);
34 | FileExt guessFileNameByRegExp(const QString& text, const QString& expression);
35 | }
36 |
37 | #endif // UTILS_GUESSFILENAME_H
38 |
--------------------------------------------------------------------------------
/gcodeshared/include/utils/splitfile.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef SPLITFILE_H
22 | #define SPLITFILE_H
23 |
24 | #include // for QT_VERSION_MAJOR
25 |
26 | class QString;
27 |
28 | #if QT_VERSION_MAJOR <= 5
29 | class QStringList;
30 | #else
31 | #include
32 | using QStringList = QList;
33 | #endif
34 |
35 |
36 | namespace Utils {
37 | QStringList splitFile(const QString& text);
38 | }
39 |
40 | #endif // SPLITFILE_H
41 |
--------------------------------------------------------------------------------
/gcodeshared/include/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef VERSION_H
21 | #define VERSION_H
22 |
23 | #ifndef GCODEWORKSHOP_VERSION
24 | #define GCODEWORKSHOP_VERSION "2025.04"
25 | #endif
26 |
27 | #endif // VERSION_H
28 |
--------------------------------------------------------------------------------
/gcodeshared/utils/configpage.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for QFrame
21 | #include // for QString
22 | #include // for QWidget
23 |
24 | #include // IWYU pragma: associated
25 |
26 |
27 | const QString& ConfigPage::toolTip()
28 | {
29 | static QString tooltip = ("");
30 | return tooltip;
31 | }
32 |
33 | void ConfigPage::add(QSharedPointer child)
34 | {
35 | if (mChild.indexOf(child) >= 0) {
36 | return;
37 | }
38 |
39 | mChild.append(child);
40 | }
41 |
42 | void ConfigPage::add(ConfigPage* child)
43 | {
44 | add(QSharedPointer(child));
45 | }
46 |
47 | QList > ConfigPage::pages()
48 | {
49 | return mChild;
50 | }
51 |
52 | QWidget* ConfigPage::widget()
53 | {
54 | if (mWidget == nullptr) {
55 | mWidget = doWidget();
56 | connect(mWidget, SIGNAL(destroyed(QObject*)), SLOT(widgetDestroed(QObject*)));
57 | }
58 |
59 | return mWidget;
60 | }
61 |
62 | QWidget* ConfigPage::doWidget()
63 | {
64 | return new QFrame();
65 | }
66 |
67 | void ConfigPage::widgetDestroed(QObject* object)
68 | {
69 | if (object == mWidget) {
70 | mWidget = 0;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/gcodeshared/utils/filepatterns.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | * Copyright (C) 2006-2018 by Artur Kozioł *
3 | * artkoz78@gmail.com *
4 | * *
5 | * This file is part of GCodeWorkShop. *
6 | * *
7 | * GCodeWorkShop is free software; you can redistribute it and/or modify *
8 | * it under the terms of the GNU General Public License as published by *
9 | * the Free Software Foundation; either version 2 of the License, or *
10 | * (at your option) any later version. *
11 | * *
12 | * This program is distributed in the hope that it will be useful, *
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 | * GNU General Public License for more details. *
16 | * *
17 | * You should have received a copy of the GNU General Public License *
18 | * along with this program; if not, write to the *
19 | * Free Software Foundation, Inc., *
20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21 | ***************************************************************************/
22 |
23 | #ifndef FILEPATTERNS_H
24 | #define FILEPATTERNS_H
25 |
26 | #define FILENAME_SINU840 "%_N_[a-zA-Z0-9_]{1,31}_(MPF|SPF|TEA|COM|PLC|DEF|INI)"
27 | #define FILENAME_OSP "\\$[A-Z]{1,1}[A-Z0-9_-]{1,}\\.(MIN|SSB|SDF|TOP|LIB|SUB|MSB)[%]{0,1}"
28 | #define FILENAME_FANUC "(?:\\n|\\r)(O|:)[0-9]{1,}"
29 | #define FILENAME_SINU "%\\b(MPF|SPF|TEA)[ \\t]{0,3}[0-9]{1,4}\\b"
30 | #define FILENAME_HEID1 "%[a-zA-Z0-9_]{1,30}( \\t)"
31 | #define FILENAME_HEID2 "(BEGIN)([ \\t]PGM[ \\t])[a-zA-Z0-9_-+*]{1,}([ \\t]MM|[ \\t]INCH)"
32 | #define FILENAME_PHIL "%PM[ \\t]{1,}N[0-9]{4,4}"
33 | #define FILENAME_FADAL "(N1)(O|:)[0-9]{1,}"
34 |
35 | #endif // FILEPATTERNS_H
36 |
--------------------------------------------------------------------------------
/gcodeworkshop/images/edytornc.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeworkshop/images/edytornc.ico
--------------------------------------------------------------------------------
/gcodeworkshop/images/edytornc48.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeworkshop/images/edytornc48.ico
--------------------------------------------------------------------------------
/gcodeworkshop/images/ncfile.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/gcodeworkshop/images/ncfile.ico
--------------------------------------------------------------------------------
/gcodeworkshop/include/documentinfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef DOCUMENTINFO_H
21 | #define DOCUMENTINFO_H
22 |
23 | #include // for shared_ptr
24 |
25 | #include // for QByteArray
26 | #include // for QString
27 |
28 | class QSettings;
29 |
30 | #define DOCUMENTINFO_CFG_KEY_TYPE "Type"
31 |
32 |
33 | class DocumentInfo
34 | {
35 | public:
36 | typedef std::shared_ptr Ptr;
37 |
38 | DocumentInfo();
39 | virtual ~DocumentInfo();
40 |
41 | virtual QString documentType() const;
42 |
43 | virtual DocumentInfo* clone() const;
44 |
45 | virtual DocumentInfo& operator=(const DocumentInfo& that);
46 |
47 | void load(QSettings* cfg);
48 | void save(QSettings* cfg) const;
49 |
50 | QString filePath;
51 | bool readOnly = false;
52 | QByteArray geometry = QByteArray();
53 |
54 | protected:
55 | virtual void loadChild(QSettings* cfg);
56 | virtual void saveChild(QSettings* cfg) const;
57 | };
58 |
59 | #endif // DOCUMENTINFO_H
60 |
--------------------------------------------------------------------------------
/gcodeworkshop/include/documentproducer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef DOCUMENTPRODUCER_H
21 | #define DOCUMENTPRODUCER_H
22 |
23 | class QString;
24 |
25 | #include // for DocumentStyle, DocumentStyle::Ptr
26 | #include // for DocumentWidgetProperties, DocumentWidgetProperties::Ptr
27 |
28 | class Document;
29 | class DocumentInfo;
30 |
31 |
32 | class DocumentProducer
33 | {
34 | public:
35 | DocumentProducer(DocumentStyle* style, DocumentWidgetProperties* properties);
36 | virtual ~DocumentProducer();
37 |
38 | virtual QString documentType() const = 0;
39 | virtual QString brief() const = 0;
40 |
41 | virtual DocumentStyle::Ptr documentStyle() const;
42 | virtual bool setDocumentStyle(const DocumentStyle::Ptr& style);
43 |
44 | virtual DocumentWidgetProperties::Ptr documentWidgetProperties() const;
45 | virtual bool setDocumentWidgetProperties(const DocumentWidgetProperties::Ptr& properties);
46 |
47 | virtual void updateDocument(Document* document);
48 |
49 | virtual Document* createDocument() const = 0;
50 | virtual DocumentInfo* createDocumentInfo() = 0;
51 | virtual DocumentStyle* createDocumentStyle() = 0;
52 | virtual DocumentWidgetProperties* createDocumentWidgetProperties() = 0;
53 |
54 | protected:
55 | DocumentStyle::Ptr m_documentStyle;
56 | DocumentWidgetProperties::Ptr m_documentWidgetProperties;
57 | };
58 |
59 | #endif // DOCUMENTPRODUCER_H
60 |
--------------------------------------------------------------------------------
/gcodeworkshop/include/documentstyle.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef DOCUMENTSTYLE_H
21 | #define DOCUMENTSTYLE_H
22 |
23 | #include // for shared_ptr
24 |
25 | #include // for QString
26 |
27 | class QSettings;
28 |
29 |
30 | class DocumentStyle
31 | {
32 | public:
33 | typedef std::shared_ptr Ptr;
34 |
35 | DocumentStyle();
36 | DocumentStyle(const DocumentStyle& that);
37 | virtual ~DocumentStyle();
38 |
39 | virtual QString documentType() const;
40 |
41 | virtual DocumentStyle* clone() const;
42 |
43 | virtual DocumentStyle& operator=(const DocumentStyle& that);
44 |
45 | void load(QSettings* cfg);
46 | void save(QSettings* cfg) const;
47 |
48 | protected:
49 | virtual void loadChild(QSettings* cfg);
50 | virtual void saveChild(QSettings* cfg) const;
51 | };
52 |
53 | #endif // DOCUMENTSTYLE_H
54 |
--------------------------------------------------------------------------------
/gcodeworkshop/include/documentwidgetproperties.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef DOCUMENTWIDGETPROPERTIES_H
21 | #define DOCUMENTWIDGETPROPERTIES_H
22 |
23 | #include // for shared_ptr
24 |
25 | #include // for QString
26 |
27 | class QSettings;
28 |
29 |
30 | class DocumentWidgetProperties
31 | {
32 | public:
33 | typedef std::shared_ptr Ptr;
34 |
35 | DocumentWidgetProperties();
36 | DocumentWidgetProperties(const DocumentWidgetProperties& that);
37 | virtual ~DocumentWidgetProperties();
38 |
39 | virtual QString documentType() const;
40 |
41 | virtual DocumentWidgetProperties* clone() const;
42 |
43 | virtual DocumentWidgetProperties& operator=(const DocumentWidgetProperties& that);
44 |
45 | void load(QSettings* cfg);
46 | void save(QSettings* cfg) const;
47 |
48 | protected:
49 | virtual void loadChild(QSettings* cfg);
50 | virtual void saveChild(QSettings* cfg) const;
51 | };
52 |
53 | #endif // DOCUMENTWIDGETPROPERTIES_H
54 |
--------------------------------------------------------------------------------
/gcodeworkshop/include/gcoderstyle.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef GCODERSTYLE_H
22 | #define GCODERSTYLE_H
23 |
24 | #include // for QString
25 |
26 | class QSettings;
27 |
28 | #include // for DocumentStyle
29 |
30 |
31 | class HighlightColors
32 | {
33 | public:
34 | int commentColor;
35 | int gColor;
36 | int mColor;
37 | int nColor;
38 | int lColor;
39 | int fsColor;
40 | int dhtColor;
41 | int rColor;
42 | int macroColor;
43 | int keyWordColor;
44 | int progNameColor;
45 | int operatorColor;
46 | int zColor;
47 | int aColor;
48 | int bColor;
49 | int defaultColor;
50 | int backgroundColor;
51 | };
52 |
53 |
54 | class GCoderStyle: public DocumentStyle
55 | {
56 | public:
57 | GCoderStyle();
58 | GCoderStyle(const GCoderStyle& that);
59 |
60 | virtual QString documentType() const override;
61 |
62 | DocumentStyle* clone() const override;
63 |
64 | DocumentStyle& operator=(const DocumentStyle& that) override;
65 | virtual GCoderStyle& operator=(const GCoderStyle& that);
66 |
67 | // Import from old settings
68 | void importFromV0(QSettings* cfg);
69 |
70 | QString fontName;
71 | int fontSize;
72 | int lineColor;
73 | int underlineColor;
74 | HighlightColors hColors;
75 |
76 | protected:
77 | void loadChild(QSettings* cfg) override;
78 | void saveChild(QSettings* cfg) const override;
79 | };
80 |
81 | #endif // GCODERSTYLE_H
82 |
--------------------------------------------------------------------------------
/gcodeworkshop/include/gcoderwidgetproperties.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef GCODERWIDGETPROPERTIES_H
22 | #define GCODERWIDGETPROPERTIES_H
23 |
24 | #include // for QString
25 |
26 | class QSettings;
27 |
28 | #include // for DocumentWidgetProperties
29 |
30 |
31 | enum WindowModeFlags {
32 | SHOW_FILENAME = 0x01,
33 | SHOW_FILEPATH = 0x02,
34 | SHOW_PROGTITLE = 0x04
35 | };
36 |
37 |
38 | class GCoderWidgetProperties: public DocumentWidgetProperties
39 | {
40 | public:
41 | GCoderWidgetProperties();
42 | GCoderWidgetProperties(const GCoderWidgetProperties& that);
43 |
44 | virtual QString documentType() const override;
45 |
46 | DocumentWidgetProperties* clone() const override;
47 |
48 | DocumentWidgetProperties& operator=(const DocumentWidgetProperties& that) override;
49 | virtual GCoderWidgetProperties& operator=(const GCoderWidgetProperties& that);
50 |
51 | bool intCapsLock;
52 | bool syntaxH;
53 | bool underlineChanges;
54 | int windowMode;
55 | bool clearUndoHistory;
56 | bool clearUnderlineHistory;
57 | bool editorToolTips;
58 | int defaultHighlightMode;
59 | bool guessFileNameByProgNum;
60 | bool changeDateInComment;
61 |
62 | protected:
63 | void loadChild(QSettings* cfg) override;
64 | void saveChild(QSettings* cfg) const override;
65 | };
66 |
67 | #endif // GCODERWIDGETPROPERTIES_H
68 |
--------------------------------------------------------------------------------
/gcodeworkshop/include/utils/expressionparser.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef UTILS_EXPRESSIONPARSER_H
22 | #define UTILS_EXPRESSIONPARSER_H
23 |
24 | class QString;
25 |
26 | #define ERR_NO_BRAC -1
27 | #define ERR_NO_PARAM -2
28 | #define ERR_CONVERT -3
29 | #define ERR_UNKNOWN_FUNC -4
30 | #define ERR_DOUBLE_DOT -5
31 |
32 |
33 | namespace Utils {
34 | int processBrc(QString* str);
35 | int compute(QString* str);
36 | }
37 |
38 | #endif // UTILS_EXPRESSIONPARSER_H
39 |
--------------------------------------------------------------------------------
/gcodeworkshop/include/utils/removezeros.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | * Copyright (C) 2006-2018 by Artur Kozioł *
3 | * artkoz78@gmail.com *
4 | * *
5 | * This file is part of GCodeWorkShop. *
6 | * *
7 | * GCodeWorkShop is free software; you can redistribute it and/or modify *
8 | * it under the terms of the GNU General Public License as published by *
9 | * the Free Software Foundation; either version 2 of the License, or *
10 | * (at your option) any later version. *
11 | * *
12 | * This program is distributed in the hope that it will be useful, *
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 | * GNU General Public License for more details. *
16 | * *
17 | * You should have received a copy of the GNU General Public License *
18 | * along with this program; if not, write to the *
19 | * Free Software Foundation, Inc., *
20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21 | ***************************************************************************/
22 |
23 | #ifndef UTILS_REMOVEZEROS_H
24 | #define UTILS_REMOVEZEROS_H
25 |
26 | class QString;
27 |
28 |
29 | namespace Utils {
30 |
31 | /**
32 | * @brief removeZeros
33 | * @param str
34 | * @return
35 | */
36 | QString removeZeros(QString str);
37 | }
38 |
39 | #endif // UTILS_REMOVEZEROS_H
40 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/capslockeventfilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef CAPSLOCKEVENTFILTER_H
21 | #define CAPSLOCKEVENTFILTER_H
22 |
23 | #include // for QObject, Q_OBJECT, slots
24 | #include // for QString
25 |
26 | class QEvent;
27 | class QKeyEvent;
28 |
29 |
30 | class CapsLockEventFilter : public QObject
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | explicit CapsLockEventFilter(QObject* parent = nullptr);
36 |
37 | public slots:
38 | void setCapsLockEnable(bool enable);
39 |
40 | protected:
41 | bool eventFilter(QObject* obj, QEvent* event) override;
42 | bool keyEvent(QKeyEvent* event);
43 |
44 | protected:
45 | bool m_capsLockEnable;
46 | };
47 |
48 | #endif // CAPSLOCKEVENTFILTER_H
49 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/documentstyle.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for Q_UNUSED
21 |
22 | #include // IWYU pragma: associated
23 |
24 |
25 | DocumentStyle::DocumentStyle()
26 | {
27 | }
28 |
29 | DocumentStyle::DocumentStyle(const DocumentStyle& that)
30 | {
31 | DocumentStyle::operator=(that);
32 | }
33 |
34 | DocumentStyle::~DocumentStyle()
35 | {
36 | }
37 |
38 | QString DocumentStyle::documentType() const
39 | {
40 | return "Document";
41 | }
42 |
43 | DocumentStyle* DocumentStyle::clone() const
44 | {
45 | DocumentStyle* style = new DocumentStyle();
46 | style->operator=(*this);
47 | return style;
48 | }
49 |
50 | DocumentStyle& DocumentStyle::operator =(const DocumentStyle& that)
51 | {
52 | Q_UNUSED(that);
53 | return *this;
54 | }
55 |
56 | void DocumentStyle::load(QSettings* cfg)
57 | {
58 | loadChild(cfg);
59 | }
60 |
61 | void DocumentStyle::save(QSettings* cfg) const
62 | {
63 | saveChild(cfg);
64 | }
65 |
66 | void DocumentStyle::loadChild(QSettings* cfg)
67 | {
68 | Q_UNUSED(cfg);
69 | }
70 |
71 | void DocumentStyle::saveChild(QSettings* cfg) const
72 | {
73 | Q_UNUSED(cfg);
74 | }
75 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/documentwidgetcloseeventfilter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for QCloseEvent
21 | #include // for QEvent
22 | #include // for Q_UNUSED
23 |
24 | #include "documentwidgetcloseeventfilter.h"
25 |
26 | DocumentWidgetCloseEventFilter::DocumentWidgetCloseEventFilter(QObject* parent)
27 | : QObject{parent}
28 | {
29 | }
30 |
31 | bool DocumentWidgetCloseEventFilter::eventFilter(QObject* obj, QEvent* event)
32 | {
33 | Q_UNUSED(obj);
34 | QCloseEvent* ce = dynamic_cast(event);
35 |
36 | if (ce) {
37 | emit closeRequested(ce);
38 | return !ce->isAccepted();
39 | }
40 |
41 | return false;
42 | }
43 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/documentwidgetcloseeventfilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef DOCUMENTWIDGETCLOSEEVENTFILTER_H
21 | #define DOCUMENTWIDGETCLOSEEVENTFILTER_H
22 |
23 | #include // QObject, Q_OBJECT, signals
24 | #include // for QString
25 |
26 | class QCloseEvent;
27 | class QEvent;
28 |
29 |
30 | class DocumentWidgetCloseEventFilter : public QObject
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | explicit DocumentWidgetCloseEventFilter(QObject* parent = nullptr);
36 |
37 | protected:
38 | bool eventFilter(QObject* obj, QEvent* event) override;
39 |
40 | signals:
41 | void closeRequested(QCloseEvent* event);
42 | };
43 |
44 | #endif // DOCUMENTWIDGETCLOSEEVENTFILTER_H
45 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/documentwidgetproperties.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for Q_UNUSED
21 |
22 | #include // IWYU pragma: associated
23 |
24 |
25 | DocumentWidgetProperties::DocumentWidgetProperties()
26 | {
27 | }
28 |
29 | DocumentWidgetProperties::DocumentWidgetProperties(const DocumentWidgetProperties& that)
30 | {
31 | DocumentWidgetProperties::operator=(that);
32 | }
33 |
34 | DocumentWidgetProperties::~DocumentWidgetProperties()
35 | {
36 | }
37 |
38 | QString DocumentWidgetProperties::documentType() const
39 | {
40 | return "Document";
41 | }
42 |
43 | DocumentWidgetProperties* DocumentWidgetProperties::clone() const
44 | {
45 | DocumentWidgetProperties* prop = new DocumentWidgetProperties();
46 | prop->operator=(*this);
47 | return prop;
48 | }
49 |
50 | DocumentWidgetProperties& DocumentWidgetProperties::operator =(const DocumentWidgetProperties& that)
51 | {
52 | Q_UNUSED(that);
53 | return *this;
54 | }
55 |
56 | void DocumentWidgetProperties::load(QSettings* cfg)
57 | {
58 | loadChild(cfg);
59 | }
60 |
61 | void DocumentWidgetProperties::save(QSettings* cfg) const
62 | {
63 | saveChild(cfg);
64 | }
65 |
66 | void DocumentWidgetProperties::loadChild(QSettings* cfg)
67 | {
68 | Q_UNUSED(cfg);
69 | }
70 |
71 | void DocumentWidgetProperties::saveChild(QSettings* cfg) const
72 | {
73 | Q_UNUSED(cfg);
74 | }
75 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/gcoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef GCODER_H
21 | #define GCODER_H
22 |
23 | #include
24 |
25 |
26 | namespace GCoder {
27 | static QLatin1String DOCUMENT_TYPE = QLatin1String("GCoder");
28 | }
29 |
30 | #endif // GCODER_H
31 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/gcoderinfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef GCODERINFO_H
21 | #define GCODERINFO_H
22 |
23 | #include // for QString
24 |
25 | class QSettings;
26 |
27 | #include // for DocumentInfo
28 |
29 |
30 | class GCoderInfo: public DocumentInfo
31 | {
32 | public:
33 | GCoderInfo();
34 | GCoderInfo(const GCoderInfo& that);
35 |
36 | QString documentType() const override;
37 |
38 | DocumentInfo* clone() const override;
39 |
40 | DocumentInfo& operator=(const DocumentInfo& that) override;
41 | virtual GCoderInfo& operator=(const GCoderInfo& that);
42 |
43 | int cursorPos = 0;
44 | int highlightMode = 0;
45 |
46 | protected:
47 | void loadChild(QSettings* cfg) override;
48 | void saveChild(QSettings* cfg) const override;
49 | };
50 |
51 | #endif // GCODERINFO_H
52 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/gcoderproducer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #include // for QLatin1String
21 |
22 | #include // for DocumentProducer
23 | #include // for GCoderDocument
24 | #include // for GCoderStyle
25 | #include // for GCoderWidgetProperties
26 |
27 | #include "gcoder.h" // for DOCUMENT_TYPE
28 | #include "gcoderinfo.h" // for GCoderInfo
29 | #include "gcoderproducer.h"
30 |
31 |
32 | class Document;
33 | class DocumentInfo;
34 | class DocumentStyle;
35 | class DocumentWidgetProperties;
36 |
37 |
38 | GCoderProducer::GCoderProducer() : DocumentProducer(new GCoderStyle(), new GCoderWidgetProperties)
39 | {
40 | }
41 |
42 | QString GCoderProducer::documentType() const
43 | {
44 | return GCoder::DOCUMENT_TYPE;
45 | }
46 |
47 | QString GCoderProducer::brief() const
48 | {
49 | return "Text edit for g-codes.";
50 | }
51 |
52 | Document* GCoderProducer::createDocument() const
53 | {
54 | GCoderDocument* gdoc = new GCoderDocument();
55 | gdoc->setDocumentStyle(documentStyle());
56 | gdoc->setDocumentWidgetProperties(documentWidgetProperties());
57 | return gdoc;
58 | }
59 |
60 | DocumentInfo* GCoderProducer::createDocumentInfo()
61 | {
62 | return new GCoderInfo();
63 | }
64 |
65 | DocumentStyle* GCoderProducer::createDocumentStyle()
66 | {
67 | return new GCoderStyle();
68 | }
69 |
70 | DocumentWidgetProperties* GCoderProducer::createDocumentWidgetProperties()
71 | {
72 | return new GCoderWidgetProperties();
73 | }
74 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/gcoderproducer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef GCODERPRODUCER_H
21 | #define GCODERPRODUCER_H
22 |
23 | #include // for QString
24 |
25 | #include // for DocumentProducer
26 |
27 | class Document;
28 | class DocumentInfo;
29 | class DocumentStyle;
30 | class DocumentWidgetProperties;
31 |
32 |
33 | class GCoderProducer : public DocumentProducer
34 | {
35 | public:
36 | GCoderProducer();
37 |
38 | QString documentType() const;
39 | QString brief() const;
40 |
41 | Document* createDocument() const;
42 | DocumentInfo* createDocumentInfo();
43 | DocumentStyle* createDocumentStyle();
44 | DocumentWidgetProperties* createDocumentWidgetProperties();
45 | };
46 |
47 | #endif // GCODERPRODUCER_H
48 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/highlightmode.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006-2018 by Artur Kozioł, artkoz78@gmail.com
3 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
4 | *
5 | * This file is part of GCodeWorkShop.
6 | *
7 | * GCodeWorkShop is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | #ifndef HIGHLIGHTMODE_H
22 | #define HIGHLIGHTMODE_H
23 |
24 | enum HighlightMode {
25 | MODE_AUTO,
26 | MODE_OKUMA,
27 | MODE_FANUC,
28 | MODE_HEIDENHAIN,
29 | MODE_SINUMERIK,
30 | MODE_SINUMERIK_840,
31 | MODE_PHILIPS,
32 | MODE_HEIDENHAIN_ISO,
33 | MODE_TOOLTIPS,
34 | MODE_LINUXCNC
35 | };
36 |
37 | #endif // HIGHLIGHTMODE_H
38 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/inlinecalc.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef INLINECALC_H
21 | #define INLINECALC_H
22 |
23 | #include // for QLineEdit
24 | #include // for Q_OBJECT, signals, slots
25 | #include // for QString
26 | #include // for QStringList
27 |
28 | class QKeyEvent;
29 | class QRect;
30 | class QWidget;
31 |
32 |
33 | class InLineCalc : public QLineEdit
34 | {
35 | Q_OBJECT
36 | public:
37 | explicit InLineCalc(QWidget* parent);
38 |
39 | void showCalc(const QString& address, const QString& selectedText, const QRect& cursorRect);
40 |
41 | protected:
42 | virtual void keyPressEvent(QKeyEvent* event) override ;
43 | void evaluate();
44 |
45 | protected slots :
46 | void done();
47 |
48 | signals:
49 | void complete(const QString& text);
50 |
51 | protected:
52 | QStringList m_wordList;
53 | QString m_address;
54 | };
55 |
56 | #endif // INLINECALC_H
57 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/recentfiles.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nick Egorrov, nicegorov@yandex.ru
3 | *
4 | * This file is part of GCodeWorkShop.
5 | *
6 | * GCodeWorkShop is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef RECENTFILES_H
21 | #define RECENTFILES_H
22 |
23 | #include // for QObject, Q_OBJECT, signals
24 | #include // for QString
25 | #include // for QStringList
26 |
27 | class QSettings;
28 |
29 |
30 | class RecentFiles : public QObject
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | enum {
36 | DEFAULT_SIZE = 16,
37 | MAX_SIZE = 32
38 | };
39 |
40 | explicit RecentFiles(QObject* parent = nullptr);
41 |
42 | QString file(int id);
43 | QStringList fileList();
44 |
45 | void add(const QString& file);
46 | void remove(const QString& file);
47 | void clear();
48 |
49 | int max();
50 | void setMax(int max);
51 |
52 | void load(QSettings* cfg);
53 | void save(QSettings* cfg);
54 |
55 | signals:
56 | void saveRequest();
57 | void fileListChanged(const QStringList& files);
58 |
59 | protected:
60 | void trim();
61 |
62 | int m_max;
63 | QStringList m_files;
64 | };
65 |
66 | #endif // RECENTFILES_H
67 |
--------------------------------------------------------------------------------
/gcodeworkshop/src/sessionnamedialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | SessionNameDialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 287
10 | 90
11 |
12 |
13 |
14 | Dialog
15 |
16 |
17 | -
18 |
19 |
20 | Enter the name of the session:
21 |
22 |
23 |
24 | -
25 |
26 |
27 |
28 |
29 |
30 | 16
31 |
32 |
33 | true
34 |
35 |
36 |
37 | -
38 |
39 |
40 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
41 |
42 |
43 | true
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/gcodeworkshop_top.pro:
--------------------------------------------------------------------------------
1 |
2 | TEMPLATE = subdirs
3 | CONFIG += ordered
4 | SUBDIRS = 3rdparty gcodeshared addons gcodeworkshop gcodefileserver
5 |
6 |
7 | include(common.pri)
8 | include(lang/lang.pri)
9 |
10 | examples.files = $$PROJECT_ROOT_PATH/examples/*
11 | doc.files = $$PROJECT_ROOT_PATH/README.md $$PROJECT_ROOT_PATH/doc/SerialTransmission_Help.html
12 | license.files = $$PROJECT_ROOT_PATH/COPYING $$PROJECT_ROOT_PATH/COPYING.LESSER
13 |
14 |
15 | # target platforms dependencies
16 | #######################################
17 |
18 | unix {
19 | mime.files = $$PROJECT_ROOT_PATH/install/linux/application-x-g-code.xml
20 | desktop.files = $$PROJECT_ROOT_PATH/install/linux/gcodeworkshop.desktop
21 | # desktop.files += $$PROJECT_ROOT_PATH/install/linux/gcodefileserver.desktop
22 |
23 | examples.path = $${PREFIX}/share/gcodeworkshop/examples
24 | doc.path = $${PREFIX}/share/doc/gcodeworkshop
25 | license.path = $${PREFIX}/share/doc/gcodeworkshop
26 | mime.path = $${PREFIX}/share/mime/packages
27 | desktop.path = $${PREFIX}/share/applications
28 |
29 | ICONS_BASE_PATH = $$PROJECT_ROOT_PATH/install/linux/images
30 | icons.base = $$ICONS_BASE_PATH
31 | icons.files = $$findFiles($$ICONS_BASE_PATH, *.png)
32 | icons.path = $${PREFIX}/share/icons
33 |
34 | INSTALLS += mime desktop icons examples doc license
35 | }
36 |
37 | macx {
38 | }
39 |
40 | win32 {
41 | examples.path = $${PREFIX}/examples
42 | doc.path = $${PREFIX}/doc
43 |
44 | INSTALLS += examples doc
45 | }
46 |
47 | !defined(VERSION, var): VERSION = $$getVersion()
48 | message(Project version: $$VERSION)
49 |
--------------------------------------------------------------------------------
/install/build-deb.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | set -e
4 |
5 | #MODE_NO_CLEAN=1
6 |
7 | PACKAGE_ARCH=$(dpkg --print-architecture)
8 | PACKAGE_INSTALL_PREFIX=/usr
9 |
10 | SCRIPT_DIR=$(realpath "$(dirname "$0")")
11 | SOURCE_DIR=$(realpath "$SCRIPT_DIR"/../)
12 |
13 | clean()
14 | {
15 | if [ -f "${PACKAGE_FILE_NAME}.deb" ]; then
16 | echo "Remove the old package ${PACKAGE_FILE_NAME}.deb"
17 | rm "${PACKAGE_FILE_NAME}.deb"
18 | fi
19 |
20 | if [ -d "${PACKAGE_DIR}/DEBIAN" ]; then
21 | echo "Remove ${PACKAGE_DIR}/DEBIAN"
22 | rm -r "${PACKAGE_DIR}/DEBIAN"
23 | fi
24 | }
25 |
26 | pre_build()
27 | {
28 | if [ "$FORCE_VERSION" = 1 ]; then
29 | QMAKE_OPTIONS="$QMAKE_OPTIONS VERSION=$PACKAGE_VERSION"
30 | fi
31 |
32 | QMAKE_OPTIONS="$QMAKE_OPTIONS PREFIX=$PACKAGE_INSTALL_PREFIX"
33 | echo "$QMAKE -r $QMAKE_OPTIONS ${SOURCE_DIR}"
34 | $QMAKE -r $QMAKE_OPTIONS ${SOURCE_DIR}
35 | }
36 |
37 | build() {
38 | make -j $MAKE_JOBS
39 | }
40 |
41 | i18n()
42 | {
43 | make -j $MAKE_JOBS i18n
44 | }
45 |
46 | deploy()
47 | {
48 | make INSTALL_ROOT="$PACKAGE_DIR" install
49 | }
50 |
51 | package()
52 | {
53 | mkdir -p "$PACKAGE_DIR"/DEBIAN
54 |
55 | get_deb_dependencies "${PACKAGE_DIR}/${PACKAGE_INSTALL_PREFIX}/bin"
56 |
57 | # https://www.debian.org/doc/debian-policy/ch-controlfields.html
58 | cat < "$PACKAGE_DIR"/DEBIAN/control
59 | Package: $PACKAGE_NAME
60 | Version: $PACKAGE_VERSION
61 | Description: GCodeWorkShop is a text editor for CNC programmers.
62 | Section: devel
63 | Priority: optional
64 | Architecture: $PACKAGE_ARCH
65 | Depends: $PACKAGE_DEPENDS
66 | Maintainer: Nick Egorrov
67 | Installed-Size: $(du -s "$PACKAGE_DIR" | awk '{print $1}')
68 | EOF
69 |
70 | title2 "Run dpkg-deb"
71 | echo "dpkg-deb --build $PACKAGE_DIR ${PACKAGE_FILE_NAME}.deb"
72 | dpkg-deb --build "$PACKAGE_DIR" "${PACKAGE_FILE_NAME}.deb"
73 | }
74 |
75 | __NESTED__=1
76 | . ${SCRIPT_DIR}/build-helper.sh
77 |
78 | create package
79 |
--------------------------------------------------------------------------------
/install/linux/application-x-g-code.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | G-code text file
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/install/linux/gcodeworkshop.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Type=Application
3 | Categories=Development;
4 | Version=1.0
5 |
6 | Name=GCodeWorkShop
7 | GenericName=G-code text editor
8 | Comment=The GCodeWorkShop is text editor for CNC programmers.
9 | Comment[pl]=GCodeWorkShop jest tekstowym edytorem dla programistów obrabiarek numerycznych CNC.
10 |
11 | Exec=gcodeworkshop %F
12 | Icon=edytornc
13 | MimeType=application/x-g-code;
14 |
15 | StartupNotify=true
16 | Terminal=false
17 | X-KDE-SubstituteUID=false
18 |
--------------------------------------------------------------------------------
/install/linux/images/hicolor/32x32/mimetypes/application-x-g-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/install/linux/images/hicolor/32x32/mimetypes/application-x-g-code.png
--------------------------------------------------------------------------------
/install/linux/images/hicolor/48x48/apps/edytornc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GCodeProjects/GCodeWorkShop/b61686a0b6da335181d9587de582b14bc5c472d2/install/linux/images/hicolor/48x48/apps/edytornc.png
--------------------------------------------------------------------------------
/lang/lang.pri:
--------------------------------------------------------------------------------
1 | # Make target i18n
2 | ########################################
3 |
4 | LANG_LIST = $$cat(languages.txt)
5 |
6 | QMAKE_EXTRA_TARGETS += i18n
7 | I18N_IN = $${PWD}
8 | I18N_OUT = $$shadowed($${I18N_IN})
9 |
10 | mkpath($${I18N_OUT})
11 |
12 | for (LANG, LANG_LIST) {
13 | write_file($${I18N_OUT}/gcodeworkshop_$${LANG}.qm)
14 | translates.files += $${I18N_OUT}/gcodeworkshop_$${LANG}.qm
15 | QMAKE_EXTRA_TARGETS += i18n_g_$${LANG}
16 | i18n.depends += i18n_g_$${LANG}
17 | i18n_g_$${LANG}.commands = $$[QT_INSTALL_BINS]/lrelease $${I18N_IN}/gcodeworkshop_$${LANG}.ts -qm $${I18N_OUT}/gcodeworkshop_$${LANG}.qm
18 | write_file($${I18N_OUT}/kdiff3_$${LANG}.qm)
19 | translates.files += $${I18N_OUT}/kdiff3_$${LANG}.qm
20 | QMAKE_EXTRA_TARGETS += i18n_k_$${LANG}
21 | i18n.depends += i18n_k_$${LANG}
22 | i18n_k_$${LANG}.commands = $$[QT_INSTALL_BINS]/lrelease $${I18N_IN}/kdiff3_$${LANG}.ts -qm $${I18N_OUT}/kdiff3_$${LANG}.qm
23 | }
24 |
25 | translates.base = $$I18N_OUT
26 | unix: translates.path = $${PREFIX}/share/gcodeworkshop/lang
27 | win32: translates.path = $${PREFIX}/lang
28 | !macx: INSTALLS += translates
29 |
30 |
31 | # Make target lupdate
32 | ########################################
33 |
34 | QMAKE_EXTRA_TARGETS += lupdate
35 | lupdate.depends = lupdateGCodeWorkShop lupdateKdiff3
36 | QMAKE_EXTRA_TARGETS += lupdateGCodeWorkShop lupdateKdiff3
37 |
38 | for (LANG, LANG_LIST) {
39 | GCODEWORKSHOP_TS += $${I18N_IN}/gcodeworkshop_$${LANG}.ts
40 | KDIFF3_TS += $${I18N_IN}/kdiff3_$${LANG}.ts
41 | }
42 |
43 | lupdateGCodeWorkShop.commands = $$[QT_INSTALL_BINS]/lupdate \
44 | $$PROJECT_ROOT_PATH/gcodeworkshop \
45 | $$PROJECT_ROOT_PATH/gcodeshared \
46 | $$PROJECT_ROOT_PATH/gcodefileserver \
47 | $$PROJECT_ROOT_PATH/addons \
48 | -ts $$GCODEWORKSHOP_TS
49 | lupdateKdiff3.commands = $$[QT_INSTALL_BINS]/lupdate \
50 | $$PROJECT_ROOT_PATH/3rdparty/kdiff3 \
51 | -ts $$KDIFF3_TS
52 |
--------------------------------------------------------------------------------
/lang/languages.txt:
--------------------------------------------------------------------------------
1 | ca cs_CZ de es fi nl pl ru
--------------------------------------------------------------------------------
/template/FANUC0T.nc:
--------------------------------------------------------------------------------
1 | %
2 | O0000 ( FANUC 0T )
3 | ( 01.02.2013 )
4 | N01G50S1500
5 | G00T0000 (TOOL 1)
6 | M41
7 | G96S0450M03
8 | X86.
9 | Z0.25
10 | G01X118M08F0.3
11 | Z0.45
12 |
13 | G00Z220M9
14 |
15 |
16 | T0000
17 | M01
18 | M05
19 | M30
20 | %
21 |
--------------------------------------------------------------------------------
/template/HAAS.nc:
--------------------------------------------------------------------------------
1 | %
2 | O0000 ( HAAS )
3 | ( 01.02.2013 )
4 | N10 G17 G40 G21 G90
5 | N20 G10 L2 P1 X-269.39 Y-254.65 Z-689.
6 | N30 T0 M06 ( TOOL )
7 | N50 S1500 M03
8 | N60 G00 G54 X5.25 Y0. T3
9 | N70 G43 Z50. H05 M08
10 | N80
11 | N90 G00 G80 Z100. M9
12 |
13 |
14 | N100 G53 G00 Z0. M05
15 | N110 G53 X-508. Y0.
16 | N120 T24 M06
17 | N130 M30
18 | %
19 |
--------------------------------------------------------------------------------
/tools/README.md:
--------------------------------------------------------------------------------
1 | Developers tools
2 | ================
3 |
4 |
5 | Astyle
6 | ------
7 |
8 | https://astyle.sourceforge.net/astyle.html
9 |
10 | Usage (from source root):
11 |
12 | astyle --project=tools/astyle.cfg -I path/to/file.cpp
13 |
14 | or
15 |
16 | astyle --project=tools/astyle.cfg -I -r 'module/*.cpp' 'module/*.h'
17 |
18 |
19 | codespell
20 | ---------
21 |
22 | https://github.com/codespell-project/codespell
23 |
24 | Usage (from source root):
25 |
26 | codespell --config tools/codespell.cfg
27 |
28 |
29 | Include-What-You-Use
30 | --------------------
31 |
32 | https://include-what-you-use.org
33 |
34 | To use IWYU, run qmake with the optional USE flag:
35 |
36 | qmake -r USE+=check_iwyu path/to/gcodeworkshop_top.pro
37 |
38 | The following additional parameters are possible:
39 |
40 | * `IWYU_INCLUDES` specifies additional paths to search for header files,
41 | this comes in handy in Debian:
42 |
43 | IWYU_INCLUDES=/usr/lib/llvm-13/include/c++/v1
44 |
45 | * `IWYU_EXTRA_FLAGS` additional options specifically IWYU:
46 |
47 | IWYU_EXTRA_FLAGS='-Xiwyu --update_comments'
48 |
49 |
50 | Additional links:
51 |
52 | * https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md
53 | * https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md
54 |
55 |
56 | Tips
57 | ----
58 |
59 | Convert png to ico
60 |
61 | convert application-x-g-code.png -define icon:auto-resize=256,128,64,48,32,24,16 gcode_file.ico
62 |
--------------------------------------------------------------------------------
/tools/astyle.cfg:
--------------------------------------------------------------------------------
1 | # astyle version 3.4
2 | # astyle --project=tools/astyle.cfg -r -I '*.cpp' '*.h'
3 |
4 | --style=kr
5 |
6 | --squeeze-lines=2
7 | --max-code-length=120
8 |
9 | # Indents
10 | --indent=tab
11 | --indent-col1-comments
12 | --min-conditional-indent=2
13 | --indent-preproc-block
14 | --indent-preproc-define
15 |
16 | # Brace Style Options
17 | --attach-namespaces
18 | --attach-closing-while # not present in astyle v2.5
19 | --break-one-line-headers # not present in astyle v2.5
20 | --add-braces
21 |
22 | # Empty Lines
23 | --break-blocks
24 | #--delete-empty-lines
25 |
26 | # White Space
27 | --pad-oper
28 | --pad-comma # not present in astyle v2.5
29 | --pad-header
30 | --unpad-paren
31 |
32 | --align-pointer=type
33 | --align-reference=type
34 |
35 | --suffix=none
36 |
37 | --ignore-exclude-errors-x
38 | --exclude=3rdparty
39 | --exclude=bin
40 | --exclude=build
41 | --exclude=doc
42 | --exclude=examples
43 | --exclude=install
44 | --exclude=lang
45 | --exclude=template
46 | --exclude=tools
47 |
--------------------------------------------------------------------------------
/tools/codespell.cfg:
--------------------------------------------------------------------------------
1 | # https://github.com/codespell-project/codespell
2 | # codespell --config tools/codespell.cfg
3 |
4 | [codespell]
5 | skip = ./3rdparty,./build,./doc,./examples,./lang
6 | ignore-words-list = doubleclick,diamon
7 | #exclude-file = ./tools/codespell_exclude.txt
8 | quiet-level = 3
9 |
--------------------------------------------------------------------------------
/tools/iwyu.imp:
--------------------------------------------------------------------------------
1 | [
2 | "ref": "iwyu_clang.imp",
3 | "ref": "iwyu_qtcore.imp",
4 | "ref": "iwyu_qtextra.imp",
5 | "ref": "iwyu_qtgui.imp",
6 | "ref": "iwyu_qtnetwork.imp",
7 | "ref": "iwyu_qtprintsupport.imp",
8 | "ref": "iwyu_qtserialport.imp",
9 | "ref": "iwyu_qtwidgets.imp",
10 | "ref": "iwyu_qtxml.imp",
11 |
12 | { include: ['"qtsingleapplication/qtsingleapplication.h"', 'private', '', 'public'] },
13 | { include: ['"../qtsingleapplication/qtsingleapplication.h"', 'private', '', 'public'] }
14 | ]
15 |
--------------------------------------------------------------------------------
/tools/iwyu_clang.imp:
--------------------------------------------------------------------------------
1 | [
2 | { include: ['"__algorithm/copy.h"', 'private', '', 'public']},
3 | { include: ['"__algorithm/max.h"', 'private', '', 'public']},
4 | { include: ['"__algorithm/min.h"', 'private', '', 'public']},
5 | { include: ['"__algorithm/sort.h"', 'private', '', 'public']},
6 | { include: ['"__functional/function.h"', 'private', '', 'public']},
7 | { include: ['"bits/shared_ptr.h"', 'private', '', 'public']},
8 | { include: ['', 'private', '', 'public']},
9 | { include: ['"__memory/shared_ptr.h"', 'private', '', 'public']},
10 | { include: ['<__memory/shared_ptr.h>', 'private', '', 'public']},
11 | { include: ['"new"', 'private', '', 'public']},
12 | { include: ['"string"', 'private', '', 'public']},
13 | { include: ['"__utility/move.h"', 'private', '', 'public']},
14 |
15 | { symbol: ['std::string', 'private', '', 'public'] }
16 | ]
17 |
--------------------------------------------------------------------------------
/tools/iwyu_comp.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | include-what-you-use $* 2>&1 | tee $(basename -- "${!#}").log
4 | exit 0
5 |
--------------------------------------------------------------------------------
/tools/iwyu_qtprintsupport.imp:
--------------------------------------------------------------------------------
1 | [
2 | { include: ['', 'private', '', 'public'] },
3 | { include: ['"qabstractprintdialog.h"', 'private', '', 'public'] },
4 | { include: ['', 'private', '', 'public'] },
5 | { include: ['"qpagesetupdialog.h"', 'private', '', 'public'] },
6 | { include: ['', 'private', '', 'public'] },
7 | { include: ['"qprintdialog.h"', 'private', '', 'public'] },
8 | { include: ['', 'private', '', 'public'] },
9 | { include: ['"qprintengine.h"', 'private', '', 'public'] },
10 | { include: ['', 'private', '', 'public'] },
11 | { include: ['"qprinter.h"', 'private', '', 'public'] },
12 | { include: ['', 'private', '', 'public'] },
13 | { include: ['"qprinterinfo.h"', 'private', '', 'public'] },
14 | { include: ['', 'private', '', 'public'] },
15 | { include: ['"qprintpreviewdialog.h"', 'private', '', 'public'] },
16 | { include: ['', 'private', '', 'public'] },
17 | { include: ['"qprintpreviewwidget.h"', 'private', '', 'public'] }
18 | ]
19 |
--------------------------------------------------------------------------------
/tools/iwyu_qtserialport.imp:
--------------------------------------------------------------------------------
1 | [
2 | { include: ['', 'private', '', 'public'] },
3 | { include: ['"qserialport.h"', 'private', '', 'public'] },
4 | { include: ['', 'private', '', 'public'] },
5 | { include: ['"qserialportinfo.h"', 'private', '', 'public'] }
6 | ]
7 |
--------------------------------------------------------------------------------