connect(ui->Box_T_zenl, SIGNAL(valueChanged(int)),this, SLOT(on_pushButton_clicked()));

  connect(ui->horizontalSlider, SIGNAL(valueChanged(int)),this, SLOT(on_pushButton_clicked()));

}

//-------------------------------------------------------------------------//

//  Вводим данные  //

//-------------------------------------------------------------------------//

double Widget::n_wr()

{

  QDate date(ui->UdateEdit->date());

  int m=date. month();

  double n=0;

  for (int i=1;i<m;i++){ //2 мясяц приб только 31

  if (i==4 || i==6 ||i==9|| i==11) {n+=30;}

  else if (i==2){

  if(date. daysInYear()==365) n+=28;

  else n+=29;

  }

  else n+=31;

  }

  n+=date. day();

  if(date. daysInYear()==366)

  return (365.0/366.0)*n;

  else return n;

}

double Widget::c_wr(){

  double x=ui->horizontalSlider->value();

  return  0.91-(0.0078788*x);

}

int Widget::min_wr()

{

  return  ui->minBox->value();

}

int Widget::hour_wr()

{

  return  ui->hourBox_2->value();

}

Coeffic Widget::Albedo_wr(){//для подстил. поверх.

  Coeffic A;

  int Index=ui->comboBox->currentIndex();

  if(Index==0){

  A. c=ui->Albedo_zem->value();

  A. c_ik=ui->Albedo_zem_IK->value();

  }

  else if(Index==1){

  A. c=0.10;

  A. c_ik=0.03;

  }

  else if(Index==2){

НЕ нашли? Не то? Что вы ищете?

  A. c=0.26;

  A. c_ik=0.03;

  }

  else if(Index==3){

  A. c=0.35;

  A. c_ik=0.05;

  }

  else if(Index==4){

  A. c=0.70;

  A. c_ik=0.014;

  }

  return A;

}

//-------------------------------------------------------------------------//

//  Реакция кнопки решения  //

//-------------------------------------------------------------------------//

void Widget::on_pushButton_clicked()//слот, что буде при нажатии кномпки

{

  int hour=hour_wr();

  int min=min_wr();

  My_Time new_time(hour, min);//IN, только тут

  Ploshadka pl;

  Coordinats coor;

  Str_Ref ref;

  Str_Ik ik;

  if((ui->bal_obl->value())>(ui->bal_obl_vverh->value())+(ui->ball_obl_nize->value())){

  ui->ball_obl_nize->setValue((ui->bal_obl->value()));

  }//поправка неверного ввода облачности

  pl. beta=ui->Box_betta->value();

  pl. gamma=ui->Box_gamma->value();

  pl. z=ui->Box_z->value();

  coor. timezone=ui->Box_utc->value();

  coor. new_time=new_time;

  coor. longitude_A=ui->Box_dogota->value();

  coor. latitude=ui->Box_shirota->value();

  coor. n=n_wr();//номер дня

  coor. c=c_wr();

  ref. A_ground=Albedo_wr().c;

  ref. A_cloud=ui->Albedo_co->value();

  ref. h_cloud=ui->Gr_obl_Verhn->value();

  ref. n_sv_cloud= ((ui->bal_obl_vverh->value())*0.1);

  ref. n_ni_cloud= ((ui->ball_obl_nize->value())*0.1);

  ref. n_all_cloud= ((ui->bal_obl->value())*0.1);

  ik. T_ground=(ui->Box_T_zenl->value()+273.0);

  ik. A_ik_ground=Albedo_wr().c_ik;

  ik. e_1=ui->Box_e1->value();

  Str_Plos_pogl pogl;

  pogl. k_pogl=ui->Box_koof_plosh->value();

  pogl. k_ikpogl=ui->Box_k_losh_IK->value();

  pogl. S=ui->Box_S->value();

  pogl. T=(ui->T_pl->value()+273.0);

  print_result(coor, pl, ref, ik, pogl);

}

//-------------------------------------------------------------------------//

//  Печать результатов  //

//-------------------------------------------------------------------------//

void Widget::print_result(Coordinats coor, Ploshadka pl,  Str_Ref ref, Str_Ik ik, Str_Plos_pogl pogl){

  ui->textEdit->clear();//текстовое поле сперва надо отчистить от мусора

  double f_c_sv=f_oblch(coor. latitude, ref. n_sv_cloud);//функция облочности над z

  double f_n=f_oblch(coor. latitude, ref. n_all_cloud);//функция облочности до земли

  QString str, str1, str2;

  str = "Высота солнца = "+QString::number(alfa(coor), 'f', 2)

  + "\t Азимут = " +QString::number(azimut(coor), 'f', 2) +"\n";

  ui->textEdit->insertPlainText( str );

  str1 = "Прямое СИ: \n\t гориз. площ \t"+QString::number(R_horiz(coor, pl. z)*f_c_sv, 'f', 5)

  + "\n\t наклон. площ \t" +QString::number(R_t(coor, pl)*f_c_sv, 'f', 5)

  + "\n\t Земля \t" +QString::number(R_horiz(coor, 0.0)*f_n, 'f', 5) +"\n";

  ui->textEdit->insertPlainText( str1 );

  str2 = "Рассеяное сверху СИ: \n\t гориз. площ \t"+QString::number(D_horiz(coor, pl. z)*f_c_sv, 'f', 5)

  + "\n\t наклон. площ \t" +QString::number(D_t(coor, pl)*f_c_sv, 'f', 5)

  + "\n\t Земля \t" +QString::number(D_horiz(coor, 0.0)*f_n, 'f', 5) +"\n";

  ui->textEdit->insertPlainText( str2 );

  QString str3,str4,str5;

  str3 = "Отраженное СИ: \n\t отр. от Земли \t" + QString::number(R_ref_groud(coor, pl, ref), 'f', 5)

  + "\n\t отр. облаками \t" +QString::number(R_ref_cloud(coor, pl, ref), 'f', 5)

  + "\n\t расс. вверх \t" +QString::number(D_verh(coor, pl, ref), 'f', 5)

  + "\n\t Суммарное \t"

  +QString::number(R_ref_groud(coor, pl, ref)+R_ref_cloud(coor, pl, ref)

  +D_verh(coor, pl, ref), 'f', 5) +"\n";

  ui->textEdit->insertPlainText( str3 );

  str4 = "ИК: \n\t Земли \t"+QString::number(IK_groud(pl, ik), 'f', 5)

  + "\n\t окр. Воздуха \t"+ QString::number(IK_atm(pl, ik), 'f', 5)

  + "\n\t Суммарное \t"+QString::number(IK_groud(pl, ik)+IK_atm(pl, ik), 'f', 5)+"\n";

  ui->textEdit->insertPlainText( str4 );

  str5 = "Суммарное тепловое излучение поглащенное приемной площадкой: \n\t СИ : \t"

  +QString::number(QsumSolar(coor, pl, ref, pogl), 'f', 2)+

  " Вт \n\t ИК : \t"+QString::number(QsumIr(pl, ik, pogl), 'f', 2)+

  " Вт \n ИК баланс: \t"+QString::number(QsumIr_balans(pl, ik, pogl), 'f', 2) + " Вт \n";

  ui->textEdit->insertPlainText( str5 );

}

Widget::~Widget()

{

  delete ui;

}



Из за большого объема этот материал размещен на нескольких страницах:
1 2 3 4 5 6 7