selectsettingwindow.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef SELECTSETTINGWINDOW_H
  2. #define SELECTSETTINGWINDOW_H
  3. #include <QInputDialog>
  4. #include <QMainWindow>
  5. #include <QDockWidget>
  6. #include <QTableWidget>
  7. #include <QXmlStreamWriter>
  8. //#include <QtXmlPatterns>
  9. #include <QTextEdit>
  10. #include <QPushButton>
  11. #include <QDir>
  12. #include <QMessageBox>
  13. class selectsettingwindow : public QMainWindow
  14. {
  15. Q_OBJECT
  16. public:
  17. explicit selectsettingwindow(QMainWindow *parent = nullptr);
  18. QDockWidget *l_dock,*r_dock;
  19. QWidget* get_centralwidget();
  20. QWidget* minisavewidget;
  21. signals:
  22. public slots:
  23. void add_dock(void);
  24. void askparametersfilename();
  25. void askparametersdirectory();
  26. void update_engravesetting(int,int);
  27. void update_cuttingsetting(int,int);
  28. private:
  29. bool set_settingspath(const QString path);
  30. //
  31. bool set_parameterspath(const QString name);
  32. QDir *m_settingsdir;
  33. QPushButton *saveButton;
  34. QPushButton *setdirButton;
  35. QTableWidget *container_rast;
  36. QTableWidget *container_cut;
  37. QXmlStreamWriter *xmlstream;
  38. QString *m_settingspath;
  39. //name,speed,
  40. //power,plunge,
  41. //passnumber,gcode s value,colortomatch
  42. QString defaultrastsettings[16][7]=
  43. {
  44. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  45. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  46. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  47. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  48. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  49. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  50. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  51. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  52. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  53. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  54. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  55. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  56. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  57. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  58. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}},
  59. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"ff000000"}}
  60. };
  61. QString defaultcutsettings[16][7]=
  62. {
  63. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#000000"}},
  64. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#808080"}},
  65. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#c0c0c0"}},
  66. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#ffffff"}},//blanc
  67. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#800000"}},
  68. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#ff0000"}},
  69. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#808000"}},
  70. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#ffff00"}},
  71. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#008000"}},
  72. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#00ff00"}},
  73. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#008080"}},
  74. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#00ffff"}},
  75. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#000080"}},
  76. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#0000ff"}},
  77. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#800080"}},
  78. {{"200%"},{"100"},{"100"},{"0"},{"10"},{"256"},{"#ff00ff"}}
  79. };
  80. QString actualrastsettings[16][7];
  81. QString actualcutsettings[16][7];
  82. QString m_actualparametersfilename;
  83. QTextEdit *textresult;
  84. QString exportsettings(QString filename, QString rastsettings[16][7],QString cutsettings[16][7]);
  85. QFile defaultfileoutput,actualfileoutput;
  86. };
  87. #endif // SELECTSETTINGWINDOW_H