volviewform.cpp 946 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "volviewform.h"
  2. #include "ui_volviewform.h"
  3. VolViewForm::VolViewForm(QWidget *parent) :
  4. QWidget(parent),
  5. ui(new Ui::VolViewForm)
  6. {
  7. ui->setupUi(this);
  8. type = 0 ;
  9. chn = 0;
  10. voltage = 0.0;
  11. current = 0.0;
  12. power = 0.0;
  13. factor = 0.0;
  14. consum = 0.0;
  15. sts = false ;
  16. ui->label_6->setAlignment(Qt::AlignCenter);
  17. if(type==0)
  18. ui->label_6->setText("Input Vol");
  19. else
  20. {
  21. QString msg ;
  22. msg += "Ch"+QString::number(chn)+":";
  23. if(sts==true)
  24. msg += "on";
  25. else
  26. msg += "off";
  27. }
  28. ui->label_8->setText(QString::number(voltage,'f',2));
  29. ui->label_13->setText(QString::number(current,'f',2));
  30. ui->label_16->setText(QString::number(power,'f',2));
  31. ui->label_15->setText(QString::number(factor,'f',2)+"%");
  32. ui->label_14->setText(QString::number(consum,'f',2));
  33. }
  34. VolViewForm::~VolViewForm()
  35. {
  36. delete ui;
  37. }