Advertisement
Jgug

S4.L1.Proc

Feb 20th, 2013
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include "proc.h"
  2. #include <QDebug>
  3. #include <math.h>
  4.  
  5. Proc::Proc() : QObject()
  6. {
  7. }
  8.  
  9. void Proc::SetVal(QString a)
  10. {
  11.     var_1 = a.toInt();
  12.     qDebug() << var_1;
  13. }
  14.  
  15. void Proc::Run_1()
  16. {
  17.     res_1 = ((var_1+2)/sqrt(2*var_1) - var_1/(sqrt(2*var_1)+2) + 2/(var_1 - sqrt(2*var_1))) * ((sqrt(var_1) - sqrt(2)) / (var_1+2));
  18.     qDebug() << var_1;
  19.     qDebug() << res_1;
  20. }
  21.  
  22. void Proc::Run_2()
  23. {
  24.     res_2 = 1 / (sqrt(var_1) + sqrt(2));
  25.     qDebug() << var_1;
  26.     qDebug() << res_2;
  27. }
  28.  
  29. void Proc::Print_1()
  30. {
  31.     emit ResOut_1(QString::number(res_1));
  32. }
  33.  
  34. void Proc::Print_2()
  35. {
  36.     emit ResOut_2(QString::number(res_2));
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement