void __fastcall TForm1::Button1Click(TObject *Sender)
{       float alfa, k, v, Vxn, Vxs, Vyn, Vys, xn ,xs, yn, ys;
        AnsiString  alfastr, xsstr;
        v = StrToFloat(Edit1->Text.c_str());
        k = StrToFloat(Edit2->Text.c_str());
        alfa = StrToFloat(Edit3->Text.c_str())*M_PI/180;
        xs = 0;
        ys = 0;
        Vxs=v*cos(alfa);
        Vys=v*sin(alfa);
        while (yn >= 0)
        {
                xn=xs+Vxs*h;
                yn=ys+Vys*h;
                Vxn=Vxs*(1-k*h);
                Vyn=Vys-(9.8+k*Vys)*h;
                Series1->AddXY(xn,yn,"",CColorGrid1->ForegroundColor);
                xs=xn;
                ys=yn;
                Vys=Vyn;
                Vxs=Vxn;
        }
        alfastr = FormatFloat("0.00", StrToFloat(Edit3->Text.c_str()));
        xsstr = FormatFloat("0.00", xs);
        Memo1->Lines->Add("Angle: " + alfastr + "   Dist: " + xsstr);
}
Exemplo n.º 2
0
//---------------------------------------------------------------------------
void TFormPici::forceCalcStat(void)
{  float average_weight=0,average_weight1=0,standardDeviation=0,standardDeviation1=0,variance=0,variance1=0;
    average_weight=(g_PiciCounter>0)?totalweight/g_PiciCounter:0.0;
    average_weight1=(qualified_counter>0)?totalweight1/qualified_counter:0.0;


     for(int i=0;i<g_PiciCounter;i++)
     {  float weight=weight_values[i];
        variance += ((average_weight-weight)*(average_weight-weight));
        if(weight>weight_ll &&  weight<weight_ul)
        { variance1+=((average_weight1-weight)*(average_weight1-weight));
        }

     }
     if(g_PiciCounter>1)standardDeviation=sqrt(variance/(g_PiciCounter-1));
     if(qualified_counter>1)standardDeviation1=sqrt(variance1/(qualified_counter-1));
     Edit_StandardDeviation->Text=FormatFloat("0.000##",standardDeviation);
     Edit_MinWeight->Text=WeightToStr(weight_minimum);
     Edit_MaxWeight->Text=WeightToStr(weight_maximum);
     Edit_totalWeight->Text=WeightToStr(totalweight);
     Edit_totalNum->Text=IntToStr(g_PiciCounter);
     Edit_QualifiedRate->Text=(g_PiciCounter>0)?FormatFloat("0.0##",100.0*qualified_counter/g_PiciCounter):(String)"0";
     Edit_Average->Text=FormatFloat("0.000##",average_weight);
     Edit_StandardDeviation1->Text=FormatFloat("0.000##",standardDeviation1);
     Edit_MinWeight1->Text=WeightToStr(weight_minimum1);
     Edit_MaxWeight1->Text=WeightToStr(weight_maximum1);
     Edit_totalWeight1->Text=WeightToStr(totalweight1);
     Edit_totalNum1->Text=IntToStr(qualified_counter);
     Edit_Average1->Text=FormatFloat("0.000##",average_weight1);
}
Exemplo n.º 3
0
//---------------------------------------------------------------------------
void __fastcall ProcesoThresholdingColorNegro::mostrarInfo_en_sglista()
{
  sgLista->Cells[3][iReg+2]=picture->Width[iReg];
  sgLista->Cells[4][iReg+2]=picture->Height[iReg];
  if(picture->TotalPixel[iReg]==0) sgLista->Cells[5][iReg+2]="0";
  else sgLista->Cells[5][iReg+2]=FormatFloat("#,###",picture->TotalPixel[iReg]);
  if(picture->LAI[iReg]==0.0) sgLista->Cells[6][iReg+2]="0.00";
  else sgLista->Cells[6][iReg+2]=FormatFloat("#.##",picture->LAI[iReg]);
  sgLista->Refresh();
}
QString ParticlesAverageAreaColumn::GetExtraInfoFooter()
{
	if (this->totalUpdatesCount == 0)
	{
		return FormatFloat(0);
	}
	else
	{
		return FormatFloat(totalParticlesArea / (float)totalUpdatesCount);
	}
}
Exemplo n.º 5
0
//---------------------------------------------------------------------------
void __fastcall TfrmCalcET0::butGenerateET0Click(TObject *Sender)
{
   condTemp->Lat_Degrees=edLatDegree->Text.ToDouble();
   condTemp->Lat_Minutes=edLatMinutes->Text.ToDouble();
   condTemp->Lat_Seconds=edLatSeconds->Text.ToDouble();

   switch(cbHemisphere->ItemIndex)
   {
    case 0:
      condTemp->Hemisphere=1;
    break;
    case 1:
      condTemp->Hemisphere=-1;
    break;
    default:
    break;
   };
   condTemp->z=edz->Text.ToDouble();
   condTemp->G=edG->Text.ToDouble();
   condTemp->Albedo=edAlbedo->Text.ToDouble();

   condTemp->Select_Wind_cat=cbSelect_Wind_cat->ItemIndex+1;
   condTemp->ThermalCond=cbThermalCond->ItemIndex+1;
   condTemp->Select_AP=cbSelect_AP->ItemIndex+1;
   if(chbSunshine->Checked)
   {
     condTemp->haveSunshine=1;
   }
   else
   {
     condTemp->haveSunshine=0;
   }
   if(chbCoeff->Checked)
   {
     condTemp->haveCoeff=1;
     condTemp->a=edCoeffA->Text.ToDouble();
     condTemp->b=edCoeffB->Text.ToDouble();
   }
   else
   {
     condTemp->haveCoeff=0;
     condTemp->a=0.0;
     condTemp->b=0.0;
   }
   condTemp->CalcularET0();
   sgClimate->RowCount=condTemp->RecNum+2;
   for(int i=1;i<=condTemp->RecNum;i++)
   {
     sgClimate->Cells[5][i+1]=FormatFloat("00.00",condTemp->ET[i-1]);
     sgClimate->Cells[4][i+1]=FormatFloat("00.00",condTemp->Sunshine[i-1]);
   }
   strcpy(condTemp->TitET,"Calculated using the tool 'Calculator ET0'");
}
Exemplo n.º 6
0
void TRadioManager::TransmitMsg(TRadioMsg * msg, TRfd * sender)
{
    TListItem * new_item = formMain->lvLog->Items->Add();
    new_item->MakeVisible(false);
    new_item->Caption = FormatFloat("#000", msg->Sender_Node->MAC_Address);

    new_item->SubItems->Add( (msg->Recipient_Node == MSG_RECIPIENT_ALL_NODES) ?
                              (AnsiString)"<ALL>" : (AnsiString) FormatFloat("#000", msg->Recipient_Node->MAC_Address) );
    AnsiString data;
    for ( sint32 i = 0; i < msg->Msg_Length; i++ )
    {
        data += IntToHex(msg->Msg_Data[i], 2) + " ";
    }
    new_item->SubItems->Add(data);

    // Transmit the message to all nodes that match the recipient address and are within transmission range
    const sint32 sender_pos_x = sender->Node_Body->Left + (sender->Node_Body->Width / 2);
    const sint32 sender_pos_y = sender->Node_Body->Top + (sender->Node_Body->Height / 2);
    for (sint32 i = 0; i < formMain->Node_List->Count; i++ )
    {
        TRfd * rx_node = (TRfd *)formMain->Node_List->Items[i];
        if ( (rx_node->MAC_Address != msg->Sender_Node->MAC_Address) &&
             ((msg->Recipient_Node == rx_node) || (msg->Recipient_Node == MSG_RECIPIENT_ALL_NODES)) )
        {
            // The address matches. Now check the range
            const sint32 rx_node_pos_x = rx_node->Node_Body->Left + (rx_node->Node_Body->Width / 2);
            const sint32 rx_node_pos_y = rx_node->Node_Body->Top + (rx_node->Node_Body->Height / 2);
            const sint32 dx = rx_node_pos_x - sender_pos_x;
            const sint32 dy = rx_node_pos_y - sender_pos_y;
            const sint32 dx2 = dx * dx;
            const sint32 dy2 = dy * dy;
            const sint32 node_dist_sq = dx2 + dy2;
            if ( node_dist_sq <= (sender->Tx_Range * sender->Tx_Range) )
            {
                // Create a copy of the message to send to each recipient
                TRadioMsg * msg_copy = new TRadioMsg(*msg);
                rx_node->Msg_Buffer->Add(msg_copy);

                // Leave a random time before the node reads the message.
                // This simulates latency and allows different nodes to answer braodcast messages in different orders
                if ( ! rx_node->Msg_Timer->Enabled )
                {
                    rx_node->Msg_Timer->Interval = Random(80) + 20;
                    rx_node->Msg_Timer->Enabled = true;
                }
            } // end of Tx range check
        } // End of address check
    } // End of node list scan loop
} // End of TransmitMsg
Exemplo n.º 7
0
// format point data for VRML output
void S3D::FormatPoint( std::string& result, const SGPOINT& point )
{
    FormatFloat( result, point.x );

    std::string tmp;
    FormatFloat( tmp, point.y );
    result.append( " " );
    result.append( tmp );

    FormatFloat( tmp, point.z );
    result.append( " " );
    result.append( tmp );

    return;
}
Exemplo n.º 8
0
//---------------------------------------------------------------------------
void __fastcall TZoom::sbFatorChange(TObject *Sender)
{
  int fator;
  fator=sbFator->Position/10;
  Dimensiona(fator);
  Status("Fator de ampliação: "+FormatFloat("0.00", fator));
}
Exemplo n.º 9
0
//---------------------------------------------------------------------------
void __fastcall TTableForm::AddNewItem(TLFDetectedItem* di)
{
    TListItem  *ListItem;
    ListItem = ListView1->Items->Add();
    ListItem->Caption = IntToStr(Form1->m_Descr.GetItemsCount()-1);

    ListItem->SubItems->Add(di->GetDetectorName());
	ListItem->SubItems->Add(ObjectTypeToString(di->GetType()));
    ListItem->SubItems->Add(FormatFloat("0.00",di->GetRaiting()));
	ListItem->SubItems->Add(IntToStr(di->GetAngle()));
	ListItem->SubItems->Add(RacursToStringHepler(di->GetRacurs()));
	ListItem->SubItems->Add(IntToStr(di->GetBW()));
    ListItem->SubItems->Add(IntToStr(di->GetBH()));

    TLFRect* rr = di->GetBounds();
    awpRect r = rr->GetRect();

    ListItem->SubItems->Add(IntToStr(r.left));
    ListItem->SubItems->Add(IntToStr(r.top));
	  ListItem->SubItems->Add(IntToStr(r.right - r.left));
	  ListItem->SubItems->Add(IntToStr(r.bottom - r.top));

    ListItem->SubItems->Add(SizeToStringHelper(Form1->m_Descr.GetItemSize(Form1->m_Descr.GetItemsCount()-1)));
    ListItem->SubItems->Add(PosToStringHelper(Form1->m_Descr.GetItemPos(Form1->m_Descr.GetItemsCount()-1)));
}
Exemplo n.º 10
0
//---------------------------------------------------------------------------
void __fastcall TForm_faturamento_dados::FormShow(TObject *Sender)
{
	BtDemonstrativo->Enabled = 0;
	BtSalvar->Enabled = 1;
	BtEditar->Enabled = 0;

	BtInserirCusto->Enabled = 1;
	BtEditarCusto->Enabled = 1;
	BtExcluirCusto->Enabled = 1;
	BtSalvarCusto->Enabled = 0;
	BtCancelarCusto->Enabled = 0;
	Form_faturamento_dados->GroupBox_itens_cobranca->Enabled = 0;

	dm_fin->qry_itens_cobranca->SQL->Text = "SELECT * FROM itens_cobranca WHERE cod_processo = '"+ dm_fin->qry_cobranca_multipla->FieldByName("id_processos_impo")->AsString +"'";
	dm_fin->qry_itens_cobranca->Open();
	dm_fin->qry_unidades->SQL->Text = "SELECT * FROM unidades WHERE cod_empresa = '"+ dm_fin->qry_cobranca_multipla->FieldByName("cod_importador")->AsString +"'";
	dm_fin->qry_unidades->Open();

	dm_fin->qry_cobrancas_master->Open();
	dm_fin->tbl_custos->Open();
	dm_fin->tbl_contas->Open();

	dm_fin->qry_cobrancas_master->FieldByName("cod_sacado")->AsString = dm_fin->qry_cobranca_multipla->FieldByName("cod_importador")->AsString;
	dm_fin->qry_cobrancas_master->FieldByName("cod_sacado_unit")->AsString = dm_fin->qry_cobranca_multipla->FieldByName("cod_unid_impo")->AsString;

	//Calcula Subtotal
	dm_fin->Query->Close();
	dm_fin->Query->SQL->Text = "SELECT SUM(valor) AS subtotal FROM itens_cobranca WHERE cod_processo = '"+ dm_fin->qry_cobranca_multipla->FieldByName("id_processos_impo")->AsString +"'";
	dm_fin->Query->Open();

	LabelSubTotal->Caption = "Subtotal: R$ "+ FormatFloat("##,##0.00", dm_fin->Query->FieldByName("subtotal")->AsFloat);
}
Exemplo n.º 11
0
void __fastcall TNakladnaForm::FormKeyDown(TObject *Sender, WORD &Key,
      TShiftState Shift)
{
   if(Shift.Contains(ssCtrl))
      if(Key == 'p' || Key == 'P' || Key == 'з' || Key == 'З' )
        cxButton3Click(*Sender);
   if(Key == VK_F2)
   {
      if(!Document->Partner->ID_Partner)
      {
         ShowMessage("введите покупателя");
         return;
      }
      TRashod * r = new TRashod(FrameList1->Query->FieldByName("id_rashod")->AsInteger);
      TTovar * t = new TTovar(r->ID_Tovar,Document->Partner->ID_Partner);
      float Cina = r->Cina;
      try
      {
         Cina = StrToFloat(InputBox("введите цену:","Цена:", FormatFloat("0.00",r->Cina)));
      }
      catch ( ... )
      {
         ShowMessage("введена неправильная цена!");
         delete r;
         delete t;
         return;
      }

      r->Cina = Cina;
      r->Save();
      delete r;
      delete t;
      Refresh();
   }
}
Exemplo n.º 12
0
void __fastcall TfrmIcdagitimHareketKontrol::ToolButton1Click(
      TObject *Sender)
{
    TDateTime dtBaslangic, dtBitis;
    int nSayac = 0;

    datamoduleORTEG->tblDONEM->Open();
    datamoduleORTEG->tblDONEM->Filter = "[DONEM_TANIMI]='"+comboDONEM->Text+"'";
    datamoduleORTEG->tblDONEM->Filtered = true;

    dtBaslangic = datamoduleORTEG->tblDONEMBASLANGIC->Value;
    dtBitis = datamoduleORTEG->tblDONEMBITIS->Value;

    datamoduleORTEG->tblDONEM->Filtered = false;
    datamoduleORTEG->tblDONEM->Close();

    queryICDAGITIM->Close();
    queryICDAGITIM->ParamByName("BASLANGIC")->AsDateTime = dtBaslangic;
    queryICDAGITIM->ParamByName("BITIS")->AsDateTime = dtBitis;    
    queryICDAGITIM->Open();

    querySTOKHAR->Close();
    querySTOKHAR->ParamByName("BASLANGIC")->AsDateTime = dtBaslangic;
    querySTOKHAR->ParamByName("BITIS")->AsDateTime = dtBitis;
    querySTOKHAR->Open();

    queryICDAGITIM->First();
    while (!queryICDAGITIM->Eof)
    {
        ProgressBar1->Position = (queryICDAGITIM->RecNo * 100) / queryICDAGITIM->RecordCount;
        ProgressBar1->Refresh();
        labelYUZDE->Caption = AnsiString(ProgressBar1->Position)+"%";
        labelYUZDE->Refresh();

        if (ceil(querySTOKHARSUMOFALIS_TUTARI->Value) != ceil(queryICDAGITIMSUMOFALIS_TUTARI->Value))
        {
            ListView1->Items->Add();
            ListView1->Items->Item[nSayac]->Caption = queryICDAGITIMBELGE_NO->Value;
            ListView1->Items->Item[nSayac]->SubItems->Insert(0, FormatFloat("###,###,###,###", querySTOKHARSUMOFALIS_TUTARI->Value));
            ListView1->Items->Item[nSayac]->SubItems->Insert(1, FormatFloat("###,###,###,###", queryICDAGITIMSUMOFALIS_TUTARI->Value));
            ++nSayac;
        }
        queryICDAGITIM->Next();
    }
    queryICDAGITIM->Close();
    Application->MessageBoxA("Kayýtlar kontrol edilmiþtir.!", "Uyarý", MB_OK | MB_ICONINFORMATION);
}
Exemplo n.º 13
0
// format vector data for VRML output
void S3D::FormatVector( std::string& result, const SGVECTOR& aVector )
{
    double X, Y, Z;
    aVector.GetVector( X, Y, Z );
    FormatFloat( result, X );

    std::string tmp;
    FormatFloat( tmp, Y );
    result.append( " " );
    result.append( tmp );

    FormatFloat( tmp, Z );
    result.append( " " );
    result.append( tmp );

    return;
}
Exemplo n.º 14
0
void __fastcall TrprHareketRaporu::DetailBand1BeforePrint(
      TQRCustomBand *Sender, bool &PrintBand)
{
    if (frmHareket->querySTOKHARMIKTAR->Value > 0 && frmHareket->querySTOKHARMIKTAR->Value < 1)
        qrlabelMIKTAR->Caption = frmHareket->querySTOKHARMIKTAR->Value;
    else
        qrlabelMIKTAR->Caption = FormatFloat("###,###,###,###.###", frmHareket->querySTOKHARMIKTAR->Value);
}
Exemplo n.º 15
0
// format Color data for VRML output
void S3D::FormatColor( std::string& result, const SGCOLOR& aColor )
{
    float R, G, B;
    aColor.GetColor( R, G, B );
    FormatFloat( result, R );

    std::string tmp;
    FormatFloat( tmp, G );
    result.append( " " );
    result.append( tmp );

    FormatFloat( tmp, B );
    result.append( " " );
    result.append( tmp );

    return;
}
Exemplo n.º 16
0
//---------------------------------------------------------------------------
AnsiString SizeToStr(int i)
{
    if (i < 1000){
        return IntToStr(i) + "B";
    }else if (i < 10000){
        return FormatFloat("0.00", i / 1000.0) + "KB";
    }else if (i < 100000){
        return FormatFloat("0.0", i / 1000.0) + "KB";
    }else if (i < 1000000){
        return IntToStr(i / 1000) + "KB";
    }else if (i < 10000000){
        return FormatFloat("0.00", i / 1000000.0) + "MB";
    }else if (i < 100000000){
        return FormatFloat("0.0", i / 1000000.0) + "MB";
    }else{
        return IntToStr(i / 1000000) + "MB";
    }
}
Exemplo n.º 17
0
void EscreveParametros(TParamsRC &ParamsRC)
{
  #ifdef DEBUG
    Log->Add("Media Altura Tarja: "+FormatFloat("###,###,##0.###", ParamsRC.ParamsABT.MediaAlturaTarja));  
    Log->Add("Luminosidade Mediana: "+FormatFloat("###,###,##0.###", ParamsRC.LumMedianaImagem));
    #define X(a, b) Log->Add(#a": "+FormatFloat("###,###,##0.###", ParamsRC.ParamsMLT.##a));
      PARAMETROS_MLT
    #undef X      ;

    #define X(a, b) Log->Add(#a": "+FormatFloat("###,###,##0.###", ParamsRC.ParamsABT.##a));
      PARAMETROS_ABT
    #undef X      ;

    #define X(a, b) Log->Add(#a": "+FormatFloat("###,###,##0.###", ParamsRC.ParamsAI.##a));
      PARAMETROS_AI
    #undef X      ;
  #endif
}     
Exemplo n.º 18
0
void __fastcall TMainCaptureForm::BitBtnPlayClick(TObject *Sender)
{

	if(outlet) {
		lsl_destroy_outlet(outlet);
		outlet = NULL;
	}
	double requestedFrameRate = edtRequestedFrameRate->Text.ToDouble();
	lsl_streaminfo info = lsl_create_streaminfo("VideoStream_0","VideoStream_0",1,requestedFrameRate,cft_int32,"");
	lsl_xml_ptr desc = lsl_get_desc(info);
	lsl_xml_ptr chn = lsl_append_child(desc, "channels");
	lsl_append_child_value(chn, "name","frame");
	lsl_append_child_value(chn,"unit","number");

	lsl_xml_ptr sync = lsl_append_child(desc, "synchronization");
	lsl_append_child_value(sync, "can_drop_samples", "true");

	outlet = lsl_create_outlet(info,0,360);


	cbVideoInputDevice->Enabled = false;
	cbVideoInput->Enabled = false;
	cbVideoInputFormat->Enabled = false;
	SpatialDivisorEdit->Enabled = false;
	cbRecord->Enabled =false;

	Start(CaptureWorkerForm, edOutput0->Text, bmpQueue, hMutex, outlet, requestedFrameRate);
	frameThread = new TFrameThread(this, bmpQueue, hMutex, false);

	BitBtnStop->Enabled=true;
	BitBtnPlay->Enabled=false;

	edtFrameRate->Text = FormatFloat ("0.00", CaptureWorkerForm->VideoGrabber->CurrentFrameRate);


	double ratio = requestedFrameRate/CaptureWorkerForm->VideoGrabber->CurrentFrameRate;
	if(ratio > 1.02 || ratio < .98) {
		edtFrameRate->Text = FormatFloat ("0.00", CaptureWorkerForm->VideoGrabber->CurrentFrameRate);
		Application->MessageBoxA(L"Camera 0 unable to display requested frame rate.", L"Error", MB_OK);
		btStopClick(this);
		return;
	}

}
void __fastcall TForm1::Button6Click(TObject *Sender)
{
        float k, alfa, x, v, d, vn, vs, Vxn, Vxs, Vyn, Vys, xn=0 ,xs=0, yn=0, ys=0;
        int i;
        AnsiString vstr;
        k = StrToFloat(Edit2->Text.c_str());
        alfa = StrToFloat(Edit4->Text.c_str())*M_PI/180;
        d = StrToFloat(Edit5->Text.c_str());
        x = 0.1;
        while (xn < d)
        {
                v = v+x;
                xs = 0;
                ys = 0;
                xn=0;
                Vxs=v*cos(alfa);
                Vys=v*sin(alfa);
                while (yn >= 0)
                {
                        xn=xs+Vxs*h;
                        yn=ys+Vys*h;
                        Vxn=Vxs*(1-k*h);
                        Vyn=Vys-(9.8+k*Vys)*h;
                        xs=xn;
                        ys=yn;
                        Vys=Vyn;
                        Vxs=Vxn;
                }
                yn=0;
        }
        for (i = 0; i < 10; i++)
        {
                if (xn==d) break;
                else if (xn < d) v = (v+(v+x))/2;
                else v = (v+(v-x))/2;
                xs = 0;
                ys = 0;
                Vxs=v*cos(alfa);
                Vys=v*sin(alfa);
                while (yn >= 0)
                {
                        xn=xs+Vxs*h;
                        yn=ys+Vys*h;
                        Vxn=Vxs*(1-k*h);
                        Vyn=Vys-(9.8+k*Vys)*h;
                        xs=xn;
                        ys=yn;
                        Vys=Vyn;
                        Vxs=Vxn;
                }
                x = x/2;
        }
        vstr = FormatFloat("0.00",v);
        Memo3->Lines->Add(vstr);
}
Exemplo n.º 20
0
//---------------------------------------------------------------------
void __fastcall TFo_About::FormShow(TObject *Sender)
{
    ApplyLanguageSetting();

    ProductName->Caption =
        AnsiString(AppTitle) +
        AnsiString(" Version ") +
        FormatFloat("0.00", AppVersion / 100.0);

    ProgramIcon->Picture->Assign(Application->Icon);
}
Exemplo n.º 21
0
// format orientation data for VRML output
void S3D::FormatOrientation( std::string& result, const SGVECTOR& axis, double rotation )
{
    double aX;
    double aY;
    double aZ;

    axis.GetVector( aX, aY, aZ );
    FormatFloat( result, aX );
    std::string tmp;
    FormatFloat( tmp, aY );
    result.append( " " );
    result.append( tmp );
    FormatFloat( tmp, aZ );
    result.append( " " );
    result.append( tmp );
    FormatFloat( tmp, rotation );
    result.append( " " );
    result.append( tmp );

    return;
}
Exemplo n.º 22
0
//---------------------------------------------------------------------------
void __fastcall TfrmAbout::FormActivate(TObject *Sender)
{
 MEMORYSTATUS MS;

  GlobalMemoryStatus(&MS);

  PhysMem->Caption  = FormatFloat("#,###' KB'", MS.dwTotalPhys / 1024.0);
  FreeRes->Caption  = IntToStr(MS.dwMemoryLoad) + " %";
  CpuLabel->Caption = FloatToStr(int((GetCPUSpeed() * 0.9989544010)*10.0)/10.0) + " МГц";

  DecimalSeparator = '.';
}
QString ParticlesAreaColumn::GetExtraInfoForLayerLine(const ParticleTimeLineWidget::LINE& line)
{
	if (!line.layer)
	{
		return QString();
	}
	
	float32 area = line.layer->GetActiveParticlesArea();
	this->totalParticlesArea += area;
	
	return FormatFloat(area);
}
void __fastcall TForm1::Button4Click(TObject *Sender)
{
        float  i, alm=0, max=0, k, v, Vxn, Vxs, Vyn, Vys, xn ,xs, yn, ys;
        AnsiString maxstr,almstr;
        v = StrToFloat(Edit1->Text.c_str());
        k = StrToFloat(Edit2->Text.c_str());
        for (i = 1; i < 91*ah; i++)
        {
                xs = 0;
                ys = 0;
                Vxs = v*cos(i/ah*M_PI/180);
                Vys = v*sin(i/ah*M_PI/180);
                while(yn>=0)
                {
                        xn = xs+Vxs*h;
                        yn = ys+Vys*h;
                        Vxn = Vxs*(1-k*h);
                        Vyn = Vys-h*(9.8+Vys*k);
                        //Series2->AddXY(xn,yn,"",clBlack);
                        xs=xn;
                        ys=yn;
                        Vxs=Vxn;
                        Vys=Vyn;
                }
                if (max <= xn)
                {
                        max=xn;
                        alm=i/ah;
                }
                xn = 0;
                yn = 0;
                Vxn = 0;
                Vyn = 0;
                Series2->AddXY(i/ah, xs, "", clRed);
        }
        maxstr = FormatFloat("0.00", max);
        almstr = FormatFloat("0.00",alm);
        Memo2->Lines->Add("Angle: " + almstr + "\r\nDistanse: " + maxstr);
}
Exemplo n.º 25
0
void __fastcall TForm_faturamento_dados::DBGrid2CellClick(TColumn *Column)
{
	dm_fin->qry_itens_cobranca->Close();
	dm_fin->qry_itens_cobranca->SQL->Text = "SELECT * FROM itens_cobranca WHERE cod_processo = '"+ dm_fin->qry_cobranca_multipla->FieldByName("id_processos_impo")->AsString +"'";
	dm_fin->qry_itens_cobranca->Open();

	//Calcula Subtotal
	dm_fin->Query->Close();
	dm_fin->Query->SQL->Text = "SELECT SUM(valor) AS subtotal FROM itens_cobranca WHERE cod_processo = '"+ dm_fin->qry_cobranca_multipla->FieldByName("id_processos_impo")->AsString +"'";
	dm_fin->Query->Open();

	LabelSubTotal->Caption = "Subtotal: R$ "+ FormatFloat("##,##0.00", dm_fin->Query->FieldByName("subtotal")->AsFloat);
}
QString ParticlesAreaColumn::GetExtraInfoForLayerLine(ParticleEffectComponent *effect, const ParticleTimeLineWidget::LINE& line)
{
	if (!line.layer)
	{
		return QString();
	}
	
	
	float32 area = effect->GetLayerActiveParticlesSquare(line.layer);
	this->totalParticlesArea += area;
	
	return FormatFloat(area);
}
Exemplo n.º 27
0
void __fastcall TfrmDMProdPG::FormShow(TObject *Sender)
{
  tc1->Panel=tch1;
  FILE * pFile;
  pFile = fopen (filename,"r");
  ifstream in(filename);
  int i;
  string line;
  char data1[20];
  char data2[20];
  int day;
  double dwtot,dwtbf;
//  wchar_t * titulo = new wchar_t[2];
  AnsiString titulo;
  getline(in,line,'\n');
  fscanf(pFile,"%s\n",&data1);
  double DMCont=strtod(data1,NULL);
  tch1->Series[0]->Clear();
  tch1->Series[1]->Clear();
  for(i=1;!in.eof();i++)
  {
    getline(in,line,'\n');
    fscanf(pFile,"%s %s\n",&data1,&data2);
    dwtot=strtod(data1,NULL);
    dwtbf=strtod(data2,NULL);
    titulo=AnsiString(i);
    tch1->Series[0]->AddXY(i,dwtot,titulo,tch1->Series[0]->Color);
    tch1->Series[1]->AddXY(i,dwtbf,titulo,tch1->Series[1]->Color);
    //tch1->Series(0)->AddXY(i,dwtot,titulo,tch1->Series(0)->Color);
    //tch1->Series(1)->AddXY(i,dwtbf,titulo,tch1->Series(1)->Color);
  }
  in.close();
  fclose(pFile);
  Edit1->Text=i-1;
  Edit2->Text=FormatFloat("0.00",float(dwtot));
  Edit3->Text=FormatFloat("0.00",float(dwtbf));
  Edit4->Text=FormatFloat("0.00",float(dwtbf/DMCont));
}
Exemplo n.º 28
0
void __fastcall TZoom::MostraInf(int X, int Y, int &r, int &g, int &b)
{
  int pixel, x, y, lum;
  float br, gr;
  x=X/(sbFator->Position/10);
  y=Y/(sbFator->Position/10);
  pixel=Image1->Picture->Bitmap->Canvas->Pixels[x][y];
  r=pixel & 0xFF;
  g=(pixel & 0xFF00) >> 0x8;
  b=pixel >> 0x10;
  lum=Round(r*0.3+g*0.59+b*0.11);
  if (r>0)
  {
    br=b*1.0/r;
    gr=g*1.0/r;
  }
  else
  {
    br=1;
    gr=1;
  }
  edX->Text=IntToStr(x);
  edY->Text=IntToStr(y);
  edX2->Text=IntToStr(0xFF-x);
  edBR->Text=FormatFloat("##0.00", br);
  edGR->Text=FormatFloat("##0.00", gr);
  edLum->Text=IntToStr(lum);
  edAzul->Text=IntToStr(b);
  edVerde->Text=IntToStr(g);
  edVermelho->Text=IntToStr(r);

  UltX=X;
  UltY=Y;
  if (cbMostraCores->Checked)
  {
    MostraCores(b, g, r);
  }
}
QString ParticlesMaxAreaColumn::GetExtraInfoForLayerLine(ParticleEffectComponent *effect, const ParticleTimeLineWidget::LINE& line)
{
	if (!line.layer)
	{
		return QString();
	}
	
	// Calculate the cumulative info.
	float32 area = effect->GetLayerActiveParticlesSquare(line.layer);
	UpdateCumulativeDataIfMaximum(line.layer, area);
	totalParticlesAreaOnThisLoop += area;
	
	return FormatFloat((float)cumulativeData[line.layer]);
}
QString ParticlesMaxAreaColumn::GetExtraInfoForLayerLine(const ParticleTimeLineWidget::LINE& line)
{
	if (!line.layer)
	{
		return QString();
	}
	
	// Calculate the cumulative info.
	float32 particlesArea = line.layer->GetActiveParticlesArea();
	UpdateCumulativeDataIfMaximum(line.layer, particlesArea);
	totalParticlesAreaOnThisLoop += particlesArea;
	
	return FormatFloat((float)cumulativeData[line.layer]);
}