pump.hpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifndef QT_INPUT_PUMP_HPP
  2. #define QT_INPUT_PUMP_HPP
  3. #include <QFrame>
  4. #include <QVBoxLayout>
  5. #include <QHBoxLayout>
  6. #include <QLabel>
  7. #include <QLineEdit>
  8. #include <QPushButton>
  9. #include <QGroupBox>
  10. #include <QDoubleValidator>
  11. #include "qt/input/data.hpp"
  12. class QtInputPump:public QFrame{
  13. Q_OBJECT
  14. private:
  15. QtInputData* data;
  16. Pump* pump;
  17. QGroupBox* init_groupbox;
  18. QGroupBox* final_groupbox;
  19. QWidget* init_final_widget;
  20. QWidget* amplitude_init_widget;
  21. QWidget* left_right_init_widget;
  22. QWidget* bottom_top_init_widget;
  23. QWidget* amplitude_final_widget;
  24. QWidget* left_right_final_widget;
  25. QWidget* bottom_top_final_widget;
  26. QVBoxLayout* main_layout;
  27. QHBoxLayout* init_final_layout;
  28. QVBoxLayout* init_layout;
  29. QVBoxLayout* final_layout;
  30. QHBoxLayout* amplitude_init_layout;
  31. QHBoxLayout* left_right_init_layout;
  32. QHBoxLayout* bottom_top_init_layout;
  33. QHBoxLayout* amplitude_final_layout;
  34. QHBoxLayout* left_right_final_layout;
  35. QHBoxLayout* bottom_top_final_layout;
  36. QPushButton* remove_button;
  37. QLabel* amplitude_init_label;
  38. QLabel* left_init_label;
  39. QLabel* right_init_label;
  40. QLabel* top_init_label;
  41. QLabel* bottom_init_label;
  42. QLabel* delta_left_init_label;
  43. QLabel* delta_right_init_label;
  44. QLabel* delta_top_init_label;
  45. QLabel* delta_bottom_init_label;
  46. QLineEdit* amplitude_init_input;
  47. QLineEdit* left_init_input;
  48. QLineEdit* right_init_input;
  49. QLineEdit* top_init_input;
  50. QLineEdit* bottom_init_input;
  51. QLineEdit* delta_left_init_input;
  52. QLineEdit* delta_right_init_input;
  53. QLineEdit* delta_top_init_input;
  54. QLineEdit* delta_bottom_init_input;
  55. QLabel* amplitude_final_label;
  56. QLabel* left_final_label;
  57. QLabel* right_final_label;
  58. QLabel* top_final_label;
  59. QLabel* bottom_final_label;
  60. QLabel* delta_left_final_label;
  61. QLabel* delta_right_final_label;
  62. QLabel* delta_top_final_label;
  63. QLabel* delta_bottom_final_label;
  64. QLineEdit* amplitude_final_input;
  65. QLineEdit* left_final_input;
  66. QLineEdit* right_final_input;
  67. QLineEdit* top_final_input;
  68. QLineEdit* bottom_final_input;
  69. QLineEdit* delta_left_final_input;
  70. QLineEdit* delta_right_final_input;
  71. QLineEdit* delta_top_final_input;
  72. QLineEdit* delta_bottom_final_input;
  73. QDoubleValidator* double_validator;
  74. QDoubleValidator* double_amplitude_validator;
  75. public:
  76. QtInputPump(QtInputData* data,Pump* pump=nullptr);
  77. ~QtInputPump();
  78. QWidget* validate();
  79. void setPump();
  80. void getPump();
  81. public slots:
  82. void emitRemove();
  83. signals:
  84. void remove(QtInputPump* input_pump);
  85. };
  86. inline
  87. QtInputPump::~QtInputPump(){
  88. delete double_validator;
  89. delete double_amplitude_validator;
  90. }
  91. inline void
  92. QtInputPump::emitRemove(){
  93. emit remove(this);
  94. }
  95. #endif