SingleCameraOperationWnd.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. #include "SingleCameraOperationWnd.h"
  2. #include "ui_SingleCameraOperationWnd.h"
  3. #include <QSettings>
  4. #include <QCloseEvent>
  5. #include <QVBoxLayout>
  6. #include <QDebug>
  7. #include <QTimer>
  8. #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
  9. SingleCameraOperationWnd::SingleCameraOperationWnd(QWidget *parent)
  10. : QMainWindow(parent)
  11. , ui(new Ui::SingleCameraOperationWnd), scaleFactor(1.0)
  12. {
  13. ui->setupUi(this);
  14. isShow = true;
  15. liveClick = true;
  16. initFrom();
  17. }
  18. SingleCameraOperationWnd::~SingleCameraOperationWnd()
  19. {
  20. delete ui;
  21. }
  22. void SingleCameraOperationWnd::initFrom() {
  23. QTimer *timer = new QTimer(this);
  24. connect(timer, &QTimer::timeout, this, &SingleCameraOperationWnd::checkSettings);
  25. timer->start(100);
  26. ui->label_Percentage->setAlignment(Qt::AlignCenter);
  27. // 设置右下部分
  28. // loadSliderStates();
  29. initSliders();
  30. initLineEdits();
  31. initProgressBar();
  32. // 连接 QSlider 的 valueChanged 信号到 QProgressBar 的 setValue 槽
  33. connect(ui->RedLightverticalSlider, &QSlider::valueChanged, ui->RedLightprogressBar, &QProgressBar::setValue);
  34. connect(ui->BlueLightverticalSlider, &QSlider::valueChanged, ui->BlueLightprogressBar, &QProgressBar::setValue);
  35. connect(ui->GreenLightverticalSlider, &QSlider::valueChanged, ui->GreenLightprogressBar, &QProgressBar::setValue);
  36. connect(ui->DotLightverticalSlider, &QSlider::valueChanged, ui->DotLightprogressBar, &QProgressBar::setValue);
  37. connectSliderAndLineEdit(ui->RedLightverticalSlider, ui->RedLightlineEdit);
  38. connectSliderAndLineEdit(ui->GreenLightverticalSlider, ui->GreenLightlineEdit);
  39. connectSliderAndLineEdit(ui->BlueLightverticalSlider, ui->BlueLightlineEdit);
  40. connectSliderAndLineEdit(ui->DotLightverticalSlider, ui->DotLightlineEdit);
  41. connect(ui->LiveButton,&QPushButton::clicked,this,&SingleCameraOperationWnd::loadLiveVedio);
  42. // 设置右上部分
  43. QWidget *viewport = ui->scrollArea->viewport();
  44. QWidget *container = new QWidget(viewport);
  45. QVBoxLayout *layout = new QVBoxLayout(container);
  46. layout->setSpacing(16); // 设置Group之间的间隔距离
  47. layout->setMargin(0);
  48. QList<int> numbers = {1, 2, 3, 4, 5, 6, 7, 8};
  49. QList<Group*> widgets;
  50. for (int i = 0; i < numbers.size(); ++i) {
  51. int num = numbers[i];
  52. CameraImageHandler* manager = new CameraImageHandler(num);
  53. Group* widget = manager->getGroup();
  54. connect(widget,&Group::send_button_Signal,this,&SingleCameraOperationWnd::showAndHideButton);
  55. connect(widget,&Group::send_ComboBox_singal,this,&SingleCameraOperationWnd::handleComBoxChange);
  56. if (widget != nullptr) {
  57. layout->addWidget(widget);
  58. widgets.append(widget);
  59. groupMap[num] = widget;
  60. }
  61. delete manager;
  62. }
  63. // 设置控件的最小高度和最大宽度
  64. int minHeight = 162;
  65. int maxWidth = 244;
  66. for (Group* w : widgets) {
  67. w->setMinimumHeight(minHeight);
  68. w->setMaximumWidth(maxWidth);
  69. }
  70. container->setLayout(layout);
  71. ui->scrollArea->setWidget(container);
  72. ui->scrollArea->resize(261, 700);
  73. ui->Operatewidget->setMouseTracking(true);
  74. connect(ui->Operatewidget,&ImageWidget::sendDoubleClicksignal,this,&SingleCameraOperationWnd::handleDoubleClick);
  75. connect(ui->DatacomboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
  76. this, &SingleCameraOperationWnd::on_DatacomboBox_currentIndexChanged);
  77. }
  78. void SingleCameraOperationWnd::closeEvent(QCloseEvent *event) {
  79. // 保存滑块状态
  80. // saveSliderStates();
  81. // 确保调用基类的 closeEvent 处理其他关闭逻辑
  82. QMainWindow::closeEvent(event);
  83. }
  84. void SingleCameraOperationWnd::initSliders() {
  85. QList<QSlider*> sliders = {
  86. ui->RedLightverticalSlider, ui->GreenLightverticalSlider,
  87. ui->BlueLightverticalSlider, ui->DotLightverticalSlider
  88. };
  89. QList<int> initialValues = {22, 11, 0, 0};
  90. for (int i = 0; i < sliders.size(); ++i) {
  91. sliders[i]->setMinimum(0);
  92. sliders[i]->setMaximum(100);
  93. sliders[i]->setValue(initialValues[i]);
  94. }
  95. }
  96. void SingleCameraOperationWnd::initLineEdits() {
  97. QList<QLineEdit*> lineEdits = {
  98. ui->RedLightlineEdit, ui->GreenLightlineEdit,
  99. ui->BlueLightlineEdit, ui->DotLightlineEdit,
  100. };
  101. for (QLineEdit* lineEdit : lineEdits) {
  102. lineEdit->setAlignment(Qt::AlignCenter);
  103. }
  104. }
  105. void SingleCameraOperationWnd::initProgressBar(){
  106. QList<int> initialValues = {22, 11, 0, 0};
  107. QList<QProgressBar*> progressBar = {
  108. ui->RedLightprogressBar,ui->GreenLightprogressBar,
  109. ui->BlueLightprogressBar,ui->DotLightprogressBar
  110. };
  111. for (int i = 0; i < progressBar.size(); ++i) {
  112. progressBar[i]->setMinimum(0);
  113. progressBar[i]->setMaximum(100);
  114. progressBar[i]->setValue(initialValues[i]);
  115. }
  116. }
  117. // void SingleCameraOperationWnd::saveSliderStates() {
  118. // QSettings settings("YourCompany", "YourApp");
  119. // settings.beginGroup("SliderStates");
  120. // settings.setValue("verticalSlider", ui->verticalSlider->value());
  121. // settings.setValue("verticalSlider_2", ui->verticalSlider_2->value());
  122. // settings.setValue("verticalSlider_3", ui->verticalSlider_3->value());
  123. // settings.setValue("verticalSlider_4", ui->verticalSlider_4->value());
  124. // settings.setValue("verticalSlider_5", ui->verticalSlider_5->value());
  125. // settings.setValue("verticalSlider_6", ui->verticalSlider_6->value());
  126. // settings.endGroup();
  127. // }
  128. // void SingleCameraOperationWnd::loadSliderStates() {
  129. // QSettings settings("YourCompany", "YourApp");
  130. // settings.beginGroup("SliderStates");
  131. // ui->verticalSlider->setValue(settings.value("verticalSlider", 11).toInt());
  132. // ui->verticalSlider_2->setValue(settings.value("verticalSlider_2", 22).toInt());
  133. // ui->verticalSlider_3->setValue(settings.value("verticalSlider_3", 9).toInt());
  134. // ui->verticalSlider_4->setValue(settings.value("verticalSlider_4", 11).toInt());
  135. // ui->verticalSlider_5->setValue(settings.value("verticalSlider_5", 0).toInt());
  136. // ui->verticalSlider_6->setValue(settings.value("verticalSlider_6", 0).toInt());
  137. // settings.endGroup();
  138. // }
  139. // QSlider 和 QLineEdit 的联动
  140. void SingleCameraOperationWnd::connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit)
  141. {
  142. QIntValidator* validator = new QIntValidator(slider->minimum(), slider->maximum(), lineEdit);
  143. lineEdit->setValidator(validator);
  144. connect(slider, &QSlider::valueChanged, [lineEdit](int value) {
  145. lineEdit->setText(QString::number(value));
  146. });
  147. connect(lineEdit, &QLineEdit::textChanged, [slider](const QString &text) {
  148. bool ok;
  149. int value = text.toInt(&ok);
  150. if (ok && value >= slider->minimum() && value <= slider->maximum()) {
  151. slider->setValue(value);
  152. } else if (!text.isEmpty()) {
  153. int closestValue = qMin(qMax(text.toInt(&ok), slider->minimum()), slider->maximum());
  154. slider->setValue(closestValue);
  155. }
  156. });
  157. }
  158. void SingleCameraOperationWnd::checkSettings() {
  159. QSettings settings("YourCompany", "YourApplication_");
  160. int groupId = settings.value("GroupId", 0).toInt();
  161. int index = settings.value("Index", 0).toInt();
  162. if (groupId != lastGroupId || index != lastIndex) {
  163. lastGroupId = groupId;
  164. lastIndex = index;
  165. loadSettings();
  166. }
  167. }
  168. void SingleCameraOperationWnd::loadSettings()
  169. {
  170. QSettings settings("YourCompany", "YourApplication_");
  171. int groupId = settings.value("GroupId", 0).toInt();
  172. int index = settings.value("Index", 0).toInt();
  173. loadGroupSettings(groupId, index);
  174. }
  175. void SingleCameraOperationWnd::loadGroupSettings(int Id, int Index) {
  176. QSettings settings("YourOrganization", "YourApplication");
  177. settings.beginGroup(QString::number(Id));
  178. QString imagePath1 = settings.value("ImagePath1").toString();
  179. int materialWndType = settings.value("MaterialWndType").toInt();
  180. QStringList textList = settings.value("TextList").toStringList();
  181. settings.endGroup();
  182. QSize size = ui->Operatewidget->size();
  183. QPixmap newPixmap;
  184. // 判断是实时图片还是物料窗口
  185. if (Index == 1) {
  186. newPixmap = QPixmap(imagePath1);
  187. clearLayout();
  188. } else if (Index == 2) {
  189. if (materialWndType == 1) {
  190. clearLayout();
  191. WaferWidget();
  192. } else if (materialWndType == 2) {
  193. clearLayout();
  194. WaffleWidget();
  195. } else if (materialWndType == 3) {
  196. clearLayout();
  197. MaterialBoxWidget();
  198. }
  199. }
  200. QPixmap scaledPixmap = newPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
  201. ui->Operatewidget->setPixmap(scaledPixmap);
  202. // 更新当前图片的成员变量
  203. currentPixmap = scaledPixmap;
  204. scaleFactor = 1.0;
  205. ui->label_Percentage->setText("100%");
  206. ui->DatacomboBox->clear();
  207. ui->DatacomboBox->addItems(textList);
  208. // qDebug() << "ComboBox items added:" << ui->DatacomboBox->count();
  209. // connect(ui->DatacomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(SingleCameraOperationWnd::onComboBoxIndexChanged(int)));
  210. }
  211. // 清除大窗口上当前的布局
  212. void SingleCameraOperationWnd::clearLayout() {
  213. // 获取当前布局
  214. QLayout* layout = ui->Operatewidget->layout();
  215. if (layout) {
  216. QLayoutItem *child;
  217. while ((child = layout->takeAt(0)) != nullptr) {
  218. if (child->widget() != nullptr) {
  219. delete child->widget(); // 删除控件
  220. }
  221. delete child; // 删除布局项
  222. }
  223. delete layout; // 删除布局本身
  224. }
  225. }
  226. // 圆晶
  227. void SingleCameraOperationWnd::WaferWidget() {
  228. // QGridLayout *layout = new QGridLayout(ui->Operatewidget);
  229. // wafer = new Wafer(2, ui->Operatewidget);
  230. // wafer->initFrom(ui->Operatewidget);
  231. // layout->setContentsMargins(0, 0, 0, 0);
  232. // layout->addWidget(wafer->globalWidget);
  233. // ui->Operatewidget->setLayout(layout);
  234. // ui->Operatewidget->setFixedSize(786, 786);
  235. }
  236. // 华夫盒
  237. void SingleCameraOperationWnd::WaffleWidget() {
  238. QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
  239. waffle = new Waffle(2, ui->Operatewidget);
  240. layout->setContentsMargins(0, 0, 0, 0);
  241. layout->addWidget(waffle);
  242. ui->Operatewidget->setLayout(layout);
  243. ui->Operatewidget->setFixedSize(786, 786);
  244. }
  245. // 料盒
  246. void SingleCameraOperationWnd::MaterialBoxWidget() {
  247. QVBoxLayout *layout = new QVBoxLayout(ui->Operatewidget);
  248. materialbox = new MaterialBox(2, ui->Operatewidget);
  249. layout->setContentsMargins(0, 0, 0, 0);
  250. layout->addWidget(materialbox);
  251. ui->Operatewidget->setLayout(layout);
  252. ui->Operatewidget->setFixedSize(786, 786);
  253. }
  254. void SingleCameraOperationWnd::on_ZoomUpButton_clicked() {
  255. scaleFactor *= 1.1;
  256. int newWidth = currentPixmap.width() * scaleFactor;
  257. int newHeight = currentPixmap.height() * scaleFactor;
  258. QPixmap scaledImage = currentPixmap.scaled(newWidth, newHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
  259. ui->Operatewidget->setPixmap(scaledImage); // 这里传递缩放后的图片
  260. double percentage = (scaleFactor * 100);
  261. QString percentageStr = QString::number((int)percentage);
  262. ui->label_Percentage->setText(QString("%1%").arg(percentageStr));
  263. }
  264. void SingleCameraOperationWnd::on_ZoomOutButton_clicked() {
  265. double newScaleFactor = scaleFactor * 0.9;
  266. if (newScaleFactor >= 1.0) {
  267. scaleFactor = newScaleFactor;
  268. } else {
  269. scaleFactor = 1.0;
  270. }
  271. int newWidth = currentPixmap.width() * scaleFactor;
  272. int newHeight = currentPixmap.height() * scaleFactor;
  273. QPixmap scaledImage = currentPixmap.scaled(newWidth, newHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
  274. ui->Operatewidget->setPixmap(scaledImage); // 这里传递缩放后的图片
  275. double percentage = scaleFactor * 100;
  276. QString percentageStr = QString::number((int)percentage);
  277. ui->label_Percentage->setText(QString("%1%").arg(percentageStr));
  278. }
  279. // void SingleCameraOperationWnd::wheelEvent(QWheelEvent *event) {
  280. // // 检查鼠标事件是否发生在 Operatewidget 上
  281. // if (ui->Operatewidget->rect().contains(ui->Operatewidget->mapFromGlobal(event->globalPos()))) {
  282. // if (event->angleDelta().y() > 0) {
  283. // scaleFactor *= 1.1;
  284. // } else {
  285. // double newScaleFactor = scaleFactor * 0.9;
  286. // // 确保新的缩放因子不小于1.0(即图片的原始大小)
  287. // if (newScaleFactor >= 1.0) {
  288. // scaleFactor = newScaleFactor;
  289. // } else {
  290. // scaleFactor = 1.0; // 如果新的缩放因子小于1.0,则直接设置为1.0
  291. // }
  292. // }
  293. // int newWidth = currentPixmap.width() * scaleFactor;
  294. // int newHeight = currentPixmap.height() * scaleFactor;
  295. // QPixmap scaledImage = currentPixmap.scaled(newWidth, newHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
  296. // ui->Operatewidget->setPixmap(scaledImage); // 这里传递缩放后的图片
  297. // double percentage = scaleFactor * 100;
  298. // QString percentageStr = QString::number((int)percentage);
  299. // ui->label_Percentage->setText(QString("%1%").arg(percentageStr));
  300. // }
  301. // QMainWindow::wheelEvent(event);
  302. // }
  303. void SingleCameraOperationWnd::wheelEvent(QWheelEvent *event) {
  304. // 检查鼠标事件是否发生在 Operatewidget 上
  305. if (ui->Operatewidget->rect().contains(ui->Operatewidget->mapFromGlobal(event->globalPos()))) {
  306. if (event->angleDelta().y() > 0) {
  307. scaleFactor *= 1.1;
  308. } else {
  309. double newScaleFactor = scaleFactor * 0.9;
  310. // 确保新的缩放因子不小于1.0(即图片的原始大小)
  311. if (newScaleFactor >= 1.0) {
  312. scaleFactor = newScaleFactor;
  313. } else {
  314. scaleFactor = 1.0; // 如果新的缩放因子小于1.0,则直接设置为1.0
  315. }
  316. }
  317. int newWidth = currentPixmap.width() * scaleFactor;
  318. int newHeight = currentPixmap.height() * scaleFactor;
  319. qDebug()<<"11111"<<newWidth<<newHeight;
  320. QPixmap scaledImage = currentPixmap.scaled(newWidth, newHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
  321. // ui->Operatewidget->setPixmap(scaledImage); // 这里传递缩放后的图片
  322. // ui->Operatewidget->setPixmapAndPoint(scaledImage);
  323. double percentage = scaleFactor * 100;
  324. QString percentageStr = QString::number((int)percentage);
  325. ui->label_Percentage->setText(QString("%1%").arg(percentageStr));
  326. }
  327. QMainWindow::wheelEvent(event);
  328. }
  329. void SingleCameraOperationWnd::onComboBoxIndexChanged(int index) {
  330. // 根据index获取图片路径
  331. QString imagePath = getImagePathFromIndex(index);
  332. if (!imagePath.isEmpty()) {
  333. QPixmap newPixmap(imagePath);
  334. QPixmap scaledPixmap = newPixmap.scaled(ui->Operatewidget->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  335. ui->Operatewidget->setPixmap(scaledPixmap);
  336. // 更新当前图片的成员变量
  337. currentPixmap = scaledPixmap;
  338. scaleFactor = 1.0;
  339. ui->label_Percentage->setText("100%");
  340. }
  341. }
  342. QString SingleCameraOperationWnd::getImagePathFromIndex(int index) {
  343. QStringList imagePaths = {
  344. ":/images/test_image/image.png",
  345. ":/images/test_image/image_2.png",
  346. };
  347. if (index >= 0 && index < imagePaths.size()) {
  348. return imagePaths[index];
  349. }
  350. return ":/images/test_image/image.png";
  351. }
  352. void SingleCameraOperationWnd::showEvent(QShowEvent *event) {
  353. QMainWindow::showEvent(event);
  354. loadSettings();
  355. }
  356. void SingleCameraOperationWnd::hideEvent(QHideEvent *event) {
  357. QMainWindow::hideEvent(event);
  358. }
  359. void SingleCameraOperationWnd::handleDoubleClick(){
  360. QPixmap scaledImage = currentPixmap.scaled(currentPixmap.width(), currentPixmap.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  361. ui->Operatewidget->setPixmap(scaledImage); // 这里传递缩放后的图片
  362. scaleFactor = 1.0;
  363. ui->label_Percentage->setText("100%");
  364. }
  365. void SingleCameraOperationWnd::showAndHideButton(){
  366. if(isShow == true){
  367. isShow = false;
  368. }else{
  369. isShow = true;
  370. }
  371. QList<QLineEdit*> lineEdits = {
  372. ui->RedLightlineEdit, ui->GreenLightlineEdit,
  373. ui->BlueLightlineEdit, ui->DotLightlineEdit,
  374. };
  375. QList<QSlider*> sliders = {
  376. ui->RedLightverticalSlider, ui->GreenLightverticalSlider,
  377. ui->BlueLightverticalSlider, ui->DotLightverticalSlider
  378. };
  379. QList<QProgressBar*> progressBar = {
  380. ui->RedLightprogressBar,ui->GreenLightprogressBar,
  381. ui->BlueLightprogressBar,ui->DotLightprogressBar
  382. };
  383. if(isShow == true){
  384. for (QLineEdit* lineEdit : lineEdits) {
  385. lineEdit->show();
  386. }
  387. for (int i = 0; i < sliders.size(); ++i) {
  388. sliders[i]->show();
  389. }
  390. for (int i = 0; i < progressBar.size(); ++i) {
  391. progressBar[i]->show();
  392. }
  393. ui->BlueLight->show();
  394. ui->RedLight->show();
  395. ui->DotLight->show();
  396. ui->GreenLight->show();
  397. ui->BlueLightlabel->show();
  398. ui->RedLightlabel->show();
  399. ui->DotLightlabel->show();
  400. ui->GreenLightlabel->show();
  401. }else{
  402. for (QLineEdit* lineEdit : lineEdits) {
  403. lineEdit->hide();
  404. }
  405. for (int i = 0; i < sliders.size(); ++i) {
  406. sliders[i]->hide();
  407. }
  408. for (int i = 0; i < progressBar.size(); ++i) {
  409. progressBar[i]->hide();
  410. }
  411. ui->BlueLight->hide();
  412. ui->RedLight->hide();
  413. ui->DotLight->hide();
  414. ui->GreenLight->hide();
  415. ui->BlueLightlabel->hide();
  416. ui->RedLightlabel->hide();
  417. ui->DotLightlabel->hide();
  418. ui->GreenLightlabel->hide();
  419. }
  420. }
  421. void SingleCameraOperationWnd::startCamera(int cameraId) {
  422. m_grabber = new ImageGrabber(cameraId);
  423. connect(m_grabber, &ImageGrabber::imageGrabbed,
  424. this, &SingleCameraOperationWnd::updateImage);
  425. m_grabber->start();
  426. }
  427. void SingleCameraOperationWnd::stopCamera(int cameraId){
  428. m_grabber->stop();
  429. }
  430. void SingleCameraOperationWnd::on_DatacomboBox_currentIndexChanged(int index){
  431. QSettings settings("YourCompany", "YourApplication_");
  432. int groupId = settings.value("GroupId", 0).toInt();
  433. if (groupMap.contains(groupId)) {
  434. Group* group = groupMap[groupId];
  435. // 修改属性
  436. group->setDatacomboBox(index);
  437. } else {
  438. qDebug() << "Group with id" << groupId << "not found.";
  439. }
  440. }
  441. void SingleCameraOperationWnd::handleComBoxChange(int groupId,int index){
  442. QSettings settings("YourCompany", "YourApplication_");
  443. int currentGroupId = settings.value("GroupId", 0).toInt();
  444. if(currentGroupId == groupId){
  445. ui->DatacomboBox->setCurrentIndex(index);
  446. }
  447. }
  448. void SingleCameraOperationWnd::updateImage(const QImage&image){
  449. QPixmap pixmap = QPixmap::fromImage(image);
  450. QSize size = ui->Operatewidget->size();
  451. // QPixmap scaledPixmap = pixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
  452. QPixmap scaledPixmap = pixmap.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
  453. ui->Operatewidget->setPixmap(scaledPixmap);
  454. }
  455. void SingleCameraOperationWnd::loadLiveVedio(){
  456. if(liveClick == true){
  457. startCamera(0);
  458. liveClick = false;
  459. }else{
  460. stopCamera(0);
  461. liveClick = true;
  462. }
  463. }