TSliderComponent::TSliderComponent(const char *AComponentName, const char *AClassName, BRect AFrame, TComponent *AFatherComponent): BSlider(AFrame,AComponentName,AComponentName,NULL,0,100),TComponentKindaView(AComponentName,AClassName,this) { float largeur,hauteur; FParent = AFatherComponent; FCodeGenerator = new TSliderCodeGenerator(this,true); FPropertyList->AddProperty(PROP_NAME,AComponentName,PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_CLASSNAME,AClassName,PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_LABEL,AComponentName,PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_MIN,"0",PROP_TYPE_FLOAT,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_MAX,"100",PROP_TYPE_FLOAT,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_THUMB,"B_BLOCK_THUMB",PROP_TYPE_FLOAT,true,false, "B_BLOCK_THUMB;B_TRIANGLE_THUMB", PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_MESSAGE,"NULL",PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_RESIZING_MODE,"B_FOLLOW_LEFT | B_FOLLOW_TOP",PROP_TYPE_FLOAT,true,false, "B_FOLLOW_LEFT;B_FOLLOW_RIGHT;B_FOLLOW_LEFT_RIGHT;B_FOLLOW_H_CENTER;B_FOLLOW_TOP;B_FOLLOW_BOTTOM;B_FOLLOW_TOP_BOTTOM;B_FOLLOW_V_CENTER;B_FOLLOW_ALL_SIDES;B_FOLLOW_NONE", PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_FLAGS,"B_NAVIGABLE | B_WILL_DRAW",PROP_TYPE_FLOAT,true,false, "B_WILL_DRAW;B_PULSE_NEEDED;B_FRAME_EVENTS;B_FULL_UPDATE_ON_RESIZE;B_NAVIGABLE;B_NAVIGABLE_JUMP;B_SUBPIXEL_PRECISE", PROP_POSITION_GROUP); GetPreferredSize(&largeur,&hauteur); ResizeTo(largeur,hauteur); AFrame = Frame(); FPropertyList->AddProperty(PROP_TOP,FloatToStr(AFrame.top),PROP_TYPE_FLOAT,false,true,"",PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_LEFT,FloatToStr(AFrame.left),PROP_TYPE_FLOAT,false,true,"",PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_RIGHT,FloatToStr(AFrame.right),PROP_TYPE_FLOAT,false,true,"",PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_BOTTOM,FloatToStr(AFrame.bottom),PROP_TYPE_FLOAT,false,true,"",PROP_POSITION_GROUP); FHandler = this; // on fait pointer le FHandler interne du TCOmponent dont on a besoin dans TComponentItem. FElement = this; // Show(); }
std::string evalute::evalute_b2Body(Watch* watch) { std::string name = watch->MemberName; std::string result = ""; b2Body* body = boost::get<b2Body*>(watch->Object); if( name == "Type") { b2BodyType type = body->GetType(); switch(type) { case b2_staticBody: result = "StaticBody"; break; case b2_dynamicBody: result = "DynamicBody"; break; case b2_kinematicBody: result = "KinematicBody"; break; default: result = "Unknown type"; } } else if(name == "Position") result = VectorToStr(body->GetPosition()); else if(name == "Angle") result = FloatToStr(body->GetAngle()); else if(name == "WorldCenter") result = VectorToStr(body->GetWorldCenter()); else if(name == "LocalCenter") result = VectorToStr(body->GetLocalCenter()); else if(name == "LinearVelocity") result = VectorToStr(body->GetLinearVelocity()); else if(name == "AngularVelocity") result = FloatToStr(body->GetAngularVelocity()); else if(name == "Inertia") result = FloatToStr(body->GetInertia()); else if(name == "LinearDamping") result = FloatToStr(body->GetLinearDamping()); else if(name == "AngularDamping")result = FloatToStr(body->GetAngularDamping()); else if(name == "Bullet") result = BoolToStr(body->IsBullet()); else if(name == "SleepingAllowed") result = BoolToStr(body->IsSleepingAllowed()); else if(name == "Awake") result = BoolToStr(body->IsAwake()); else if(name == "Active") result = BoolToStr(body->IsActive()); else if(name == "FixedRotation") result = BoolToStr(body->IsFixedRotation()); bool mass = false; std::string massValuePrefix = "", massCenterPrefix = "", massRotationInertiaPrefix = ""; b2MassData massData; body->GetMassData(&massData); if( name == "Mass") { mass = true; result = "{ "; massValuePrefix = "Value = "; massCenterPrefix = ", Center = "; massRotationInertiaPrefix = ", RotationInertia = "; } if( name == "Mass.Value" || mass) result += massValuePrefix + FloatToStr(massData.mass); if( name == "Mass.Center" || mass) result += massCenterPrefix + VectorToStr(massData.center); if( name == "Mass.RotationInertia" || mass) result += massRotationInertiaPrefix + FloatToStr(massData.I); if(mass) result += " }"; if(result == "") result = "Can't evalute"; return result; }
void __fastcall TfrmPropVisor::DownClickDbl(TObject *Sender) { const long double inc = 0.01; long double value; try{ value = StrToFloatDef(((TEdit*)((TCSpinButton*)Sender)->FocusControl)->Text, 1); }catch(...){ return;} if( (value - inc) > 0.0 ) value -= inc; else value = 1; ((TEdit*)((TCSpinButton*)Sender)->FocusControl)->Text = FloatToStr(value); }
void __fastcall TfrmPropVisor::UpClickInt(TObject *Sender) { const int inc = 1; int value; try{ value = StrToIntDef(((TEdit*)((TCSpinButton*)Sender)->FocusControl)->Text, 1); }catch(...){ return;} if( (value + inc) <= ((TEdit*)((TCSpinButton*)Sender)->FocusControl)->Tag ) value += inc; else value = ((TEdit*)((TCSpinButton*)Sender)->FocusControl)->Tag; ((TEdit*)((TCSpinButton*)Sender)->FocusControl)->Text = FloatToStr(value); }
//--------------------------------------------------------------------------- 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 = "Частота процессора : "; CpuLabel->Caption = CpuLabel->Caption + FloatToStr(int((GetCPUSpeed() * 0.9989544010)*10.0)/10.0) + " МГц"; //DecimalSeparator = '.'; }
void __fastcall TForm1::Button2Click(TObject *Sender) { double a = StrToFloat(Edit3->Text); double b = StrToFloat(Edit4->Text); double c = StrToFloat(Edit5->Text); z = calculate(1, 2)+1/2.; z = f() + fabs(pow(x - sin(y),1/3.)); z = fabs(pow(y+9/5.+f(1, 2),1/3.)); z = func(a(1/2.,1/2.),3); z=mas[i+2]+1/2.; double ans = arifm((a + b) / (a - c * b), b * b - 2 * a * c, 3 * pow(c, a - b)) - arifm((c + a) / (a * b), sqrt(b) / pow(a, 1. / 3), pow(a, b + 1. / c)); ShowMessage(FloatToStr(ans)); }
void __fastcall TSharpnessForm1::btn_sp_SaveClick(TObject *Sender) { if(!SaveDialog1->Execute()) return; String Fpath = SaveDialog1->FileName; FILE* fptr = fopen (Fpath.c_str(),"w"); AnsiString str[5]; str[0] = "TEXT_DET"; str[1] = "HORZ_THR"; str[2] = "VERT_THR"; str[3] = "EDGE_THR"; str[4] = "GLT_STR"; //hardwre gain AnsiString input_str[5]; for(int i = 0; i <= 3; i++) input_str[i] = "0"; input_str[4] = "1"; for(int i = 0; i < OSP->SPChkBox_Nbr; i++){ if(SameText(ChkB[i]->Addr.Name(),str[0])){ input_str[0] = (ChkB[i]->Chkb->Checked?"1":"0"); break; } } for(int j = 0; j <= 3; j++) for(int i = 0; i < OSP->SPScrollBar_Nbr; i++){ if(SameText(ScrlB[i]->Addr.Name(),str[j])){ input_str[j] = ScrlB[i]->ScrlB->Position; break; } } for(int i = 0; i < OSP->SPScrollBar_Nbr; i++){ if(SameText(ScrlB[i]->Addr.Name(),str[4])){ float val = (float)ScrlB[i]->ScrlB->Position*4; input_str[4] = FloatToStr(val); break; } } float input_str5 = StrToFloat(sb_softgain->Position)/10; fprintf(fptr,"%s\t%s\t%s\t%s\t%s\t%f\n",input_str[0],input_str[1],input_str[2], input_str[3],input_str[4],input_str5); for(int i = 0; i < 32; i++){ fprintf(fptr,"%d\n", SP_lut[i]); } fclose(fptr); }
void __fastcall TForm1::Button1Click(TObject *Sender) { double matrix[8][8]={ {0,1,0,0,1,0,1,0}, {1,0,1,0,0,0,0,0}, {0,1,0,1,0,0,1,0}, {0,0,1,0,0,0,1,1}, {1,0,0,0,0,1,0,0}, {0,0,0,0,1,0,0,0}, {1,0,1,1,0,0,0,1}, {0,0,0,1,0,0,1,0} }; get_matr (matrix); Edit1->Text =FloatToStr(det (matrix)); }
moText moGLMatrixf::ToJSON() const { moText JSON = "["; moText comma="",nline=""; for(int j=0;j<4; j++) { JSON+= nline; for(int i=0;i<4; i++) { JSON+= comma + FloatToStr( (*this)[j][i] ); comma=","; } nline="\n"; } JSON+= "]"; return JSON; }
void __fastcall TframTag::edtCompDevPercentChange(TObject *Sender) { // try{ __r4 percent; percent = StrToFloat(edtCompDevPercent->Text); if(percent < 0 || percent > 100){ return; } __r4 span = _getSpan(&m_Tag); m_Tag.s.CompDev = percent * span / 100; edtCompDev->Text = FloatToStr(m_Tag.s.CompDev); }catch(...){ } }
TTextControlComponent::TTextControlComponent(const char *AComponentName,const char *AClassName, BRect AFrame, TComponent *AFatherComponent): BTextControl(AFrame,AComponentName,NULL,"Some Text",NULL,B_FOLLOW_LEFT | B_FOLLOW_TOP,B_FRAME_EVENTS | B_WILL_DRAW | B_NAVIGABLE),TComponentKindaView(AComponentName,AClassName,this) { float largeur,hauteur; FHandler = this; FParent = AFatherComponent; FCodeGenerator = new TTextControlCodeGenerator(this,true); FPropertyList->AddProperty(PROP_NAME,AComponentName,PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_CLASSNAME,AClassName,PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); if (Label()==NULL) { FPropertyList->AddProperty(PROP_LABEL,"",PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); } else FPropertyList->AddProperty(PROP_LABEL,Label(),PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_MESSAGE,"NULL",PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); FPropertyList->AddProperty(PROP_RESIZING_MODE,"B_FOLLOW_LEFT | B_FOLLOW_TOP",PROP_TYPE_FLOAT,true,false, "B_FOLLOW_LEFT;B_FOLLOW_RIGHT;B_FOLLOW_LEFT_RIGHT;B_FOLLOW_H_CENTER;B_FOLLOW_TOP;B_FOLLOW_BOTTOM;B_FOLLOW_TOP_BOTTOM;B_FOLLOW_V_CENTER;B_FOLLOW_ALL_SIDES;B_FOLLOW_NONE", PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_FLAGS,"B_NAVIGABLE | B_WILL_DRAW",PROP_TYPE_FLOAT,true,false, "B_WILL_DRAW;B_PULSE_NEEDED;B_FRAME_EVENTS;B_FULL_UPDATE_ON_RESIZE;B_NAVIGABLE;B_NAVIGABLE_JUMP;B_SUBPIXEL_PRECISE", PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_TEXT,Text(),PROP_TYPE_STRING,false,true,"",PROP_GENERAL_GROUP); GetPreferredSize(&largeur,&hauteur); ResizeTo(largeur,hauteur); AFrame = Frame(); FPropertyList->AddProperty(PROP_TOP,FloatToStr(AFrame.top),PROP_TYPE_FLOAT,false,true,"",PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_LEFT,FloatToStr(AFrame.left),PROP_TYPE_FLOAT,false,true,"",PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_RIGHT,FloatToStr(AFrame.right),PROP_TYPE_FLOAT,false,true,"",PROP_POSITION_GROUP); FPropertyList->AddProperty(PROP_BOTTOM,FloatToStr(AFrame.bottom),PROP_TYPE_FLOAT,false,true,"",PROP_POSITION_GROUP); }
void __fastcall TFormMain::OnAnyTrackBarChange( TObject *Sender) { const int sz = TrackBarSize->Position; const double angle = 2.0 * M_PI * static_cast<double>(TrackBarAngle->Position) / static_cast<double>(TrackBarAngle->Max); const double wavelength = 16.0 * static_cast<double>(TrackBarWavelength->Position) / static_cast<double>(TrackBarWavelength->Max); const double sigma = CalculateSigma(sz/2); LabelSize->Caption = "Size: " + IntToStr(sz) + " pixels"; LabelAngle->Caption = "Angle: " + FloatToStr(angle) + " radians"; LabelWavelength->Caption = "Wavelength: " + FloatToStr(wavelength) + " pixels"; LabelSigma->Caption = "Sigma: " + FloatToStr(sigma); mFilter = CreateGaborFilter(sz,angle,wavelength,sigma); SurfacePlotter p(ImageFilter); p.SetSurfaceGrey(mFilter); ImageFilter->Refresh(); }
void __fastcall THSVFormOrg::Hue_ImgMouseDown(TObject * Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { int color; double h, s, v, i, r, g, b; color = Hue_Img->Canvas->Pixels[X][Y]; b = color / 65536; g = color / 256 % 256; r = color % 256; rgb2hsv(r, g, b, &h, &s, &i, &v); ed_Hue_Custom->Text = FloatToStr(h); Set_6HSV_grid(); }
void imprimirValor(struct ArgPresentaValor* arg){ byte decimales= getDecimales(); int Val= getValor(arg); char str[7]; OutputStream_writeStr(getCartel(arg)); if(arg->val!=NULL) { OutputStream_writeStr(" "); FloatToStr(Val,str,6,decimales); OutputStream_writeStr(str); OutputStream_writeStr(" "); }else OutputStream_writeStr("\n"); }
// --------------------------------------------------------------------------- void __fastcall TStdDataForm::FilterOnRadioGroupClick(TObject *Sender) { FilterOnLabel->Caption = "Records where " + FilterOnRadioGroup->Items->Strings[FilterOnRadioGroup->ItemIndex] + " >="; switch (FilterOnRadioGroup->ItemIndex) { case 0: Orders->OnFilterRecord = OrdersFilterOnDate; FilterCriteria->Text = DateToStr(FLastDate); break; case 1: Orders->OnFilterRecord = OrdersFilterOnAmount; FilterCriteria->Text = FloatToStr(FLastAmount); break; } ActiveControl = FilterCriteria; }
void __fastcall TForm1::Button1Click(TObject *Sender) { double x = StrToFloat(Edit1->Text); double y = StrToFloat(Edit2->Text); if (x != 0) { double ans = exp((sin(y) - x) * (cos(y) + x)) + sqrt(fabs( ((sin(y) - x) * (cos(y) + x)) / (pow(10, 5) * log(3 * x)) )); ShowMessage(FloatToStr(ans)); } z = pow(sin(x)-pow(y,(3+20)/9), 2); z = ((1+2)/(3+4)); z = calculate(1/2, 1) + 1/2.; }
//--------------------------------------------------------------------------- void __fastcall TFormSummaryRep::ShowHighFooter(TDataSet *DataSet) { TDBGridColumnsEh* Columns; switch (DataSet->Tag) { case 1: Columns = DBGridEh1->Columns; for (int i = 1; i < 14; i++) { Columns->Items[i]->Footers->Items[0]->Value = FloatToStr(Sum1[i]); } break; case 2: Columns = DBGridEh2->Columns; for (int i = 2; i < 41; i++) { Columns->Items[i]->Footers->Items[0]->Value = IntToStr(Sum2[i]); } break; } }
void __fastcall TForm1::Button4Click(TObject *Sender) { const int N = 2; double w[N][2]; double h[N]; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { w[i][j] = StrToFloat(StringGrid2->Cells[j + 1][i + 1]); } h[i] = StrToFloat(StringGrid2->Cells[3][i + 1]); } double s = 0; for (int i = 0; i < 2; i++) { s += perimeter(w[i][0], w[i][1], h[i]); } ShowMessage(FloatToStr(s)); }
//--------------------------------------------------------------------------- void __fastcall TfrmProximityForm::DoReadRSSI(TObject *Sender, int ARssiValue, TBluetoothGattStatus *AGattStatus) { int LRatioDB; double LRatioLinear, LDistance; //Discard wrong values if (ARssiValue > 0) return; lblTxPower->Text = IntToStr(FTxPowerValue); lblRSSI->Text = IntToStr(ARssiValue) + ' dBm'; LRatioDB = FTxPowerValue - ARssiValue; LRatioLinear = pow(10, LRatioDB / 10); LDistance = Sqrt(LRatioLinear); lblDistance->Text = FloatToStr(LDistance); lblDist2->Text = IntToStr(FTxPowerValue - ARssiValue); CheckDistanceThreshold(FTxPowerValue - ARssiValue); }
void __fastcall TfrmPropVisor::FormActivate(TObject *Sender) { chkEjex->Checked = dsgPrevia->ShowAxeX; chkEjey->Checked = dsgPrevia->ShowAxeY; txtEjeXNombre->Text = dsgPrevia->NameAxeX; txtEjeYNombre->Text = dsgPrevia->NameAxeY; cboDirEjeX->ItemIndex = (dsgPrevia->DirectionAxeX == drLeftToRight)? 0 : 1; cboDirEjeY->ItemIndex = (dsgPrevia->DirectionAxeY == drBottomToTop)? 0 : 1; cbxColorEjeX->Selected = dsgPrevia->AxeX->Color; cbxColorEjeY->Selected = dsgPrevia->AxeY->Color; cboEstiloX->ItemIndex = int(dsgPrevia->AxeX->Style); cboEstiloY->ItemIndex = int(dsgPrevia->AxeY->Style); edtGrosorX->Value = dsgPrevia->AxeX->Width; edtGrosorY->Value = dsgPrevia->AxeY->Width; chkMostrarPuntero->Checked = dsgPrevia->ShowPointer; cbxFondo->Selected = dsgPrevia->BackGround->Color; chkEjexClick(Sender); chkEjeyClick(Sender); chkNumX->Checked = dsgPrevia->ShowLabelsAxeX; chkNumY->Checked = dsgPrevia->ShowLabelsAxeY; edtLabelStepX->Text = FloatToStr(dsgPrevia->LabelsStepX); edtLabelStepY->Text = FloatToStr(dsgPrevia->LabelsStepY); edtAddTextX->Text = dsgPrevia->AdditionalStringAxeX; edtAddTextY->Text = dsgPrevia->AdditionalStringAxeY; chkSobreX->Checked = dsgPrevia->LabelsToTheTopOfAxeX; chkDerY->Checked = dsgPrevia->LabelsToTheRigthOfAxeY; chkNumYClick(Sender); chkNumYClick(Sender); chkMarksX->Checked = dsgPrevia->ShowMarksAxeX; chkMarksY->Checked = dsgPrevia->ShowMarksAxeY; edtMarksStepX->Text = FloatToStr(dsgPrevia->MarksStepX); edtMarksStepY->Text = FloatToStr(dsgPrevia->MarksStepY); edtMarksLongX->Text = IntToStr(dsgPrevia->MarksLengthAxeX); edtMarksLongY->Text = IntToStr(dsgPrevia->MarksLengthAxeY); chkMarksXClick(Sender); chkMarksYClick(Sender); chkGridX->Checked = dsgPrevia->ShowGridX; chkGridY->Checked = dsgPrevia->ShowGridY; edtPasoGridX->Text = FloatToStr(dsgPrevia->GridStepX); edtPasoGridY->Text = FloatToStr(dsgPrevia->GridStepY); cboStyleGridX->ItemIndex = int(dsgPrevia->GridX->Style); cboStyleGridY->ItemIndex = int(dsgPrevia->GridY->Style); edtWidthGridX->Text = IntToStr(dsgPrevia->GridX->Width); edtWidthGridY->Text = IntToStr(dsgPrevia->GridY->Width); cboColorGridX->Selected = dsgPrevia->GridX->Color; cboColorGridY->Selected = dsgPrevia->GridY->Color; chkGridXClick(Sender); chkGridYClick(Sender); edtZoomX->Text = IntToStr(dsgPrevia->ZoomAxeX); edtZoomY->Text = IntToStr(dsgPrevia->ZoomAxeY); }
void checkVoltage() { unsigned int tmp_volt = 0; float voltage; tmp_volt = ADC_Read(VOLT_CH); a_volt = (a_volt + tmp_volt) >> 1; voltage = a_volt * 4; voltage = voltage / 1000; voltage = voltage * 4.191; if (a_volt != last_avolt){ last_avolt = a_volt; FloatToStr(voltage, tmpString); memcpy(VOLT_STR, tmpString, 4); rx_lcdFlag = 1; voltageFlag = 0; } }
//--------------------------------------------------------------------------- void __fastcall TForm1::FormShow(TObject *Sender) { // подключаем базу TIniFile *ini; ini = new TIniFile(".\\biz.ini"); s=0; IBDatabase1->DatabaseName=ini->ReadString("server","name","\\combibone\d:\Project1\Progz\FINAL\KNPP.GDB"); manag=ini->ReadString("server","user","SYSDBA"); IBDatabase1->Params->Add("User_Name="+ini->ReadString("server","user","SYSDBA")); try { IBDatabase1->Open(); Form1->IBQuery1->Open(); Form1->IBQuery1->First(); while(!IBQuery1->Eof) { s=s+IBQuery1->FieldByName("summ")->AsFloat; IBQuery1->Next(); }; StatusBar1->Panels->Items[1]->Text=FloatToStr(s); Form1->IBQuery1->First(); } catch(...) { // если пароль не верный то выход ShowMessage("Не верный пароль или логин "); Application->Terminate(); } }
//--------------------------------------------------------------------------- int CTerminalRobotTyper::SendBonusKeys(){ int keysCount =0; //设置并刷新终端监控信息 Bonus *currentBonus =(Bonus *)terminal->currentRequest; TStringList *line =new TStringList(); line->Add(IntToStr(currentBonus->id)); line->Add(currentBonus->seq); line->Add(FloatToStr(currentBonus->bonus/100)); terminal->panel->topLineContent =line; Synchronize(&terminal->panel->FillTopLineContent); delete line; //发送序列码按键 keysCount +=terminal->box->TypeInnerString(terminal->xmlConfig->Keyboard->BobusPrefix); //兑奖按键前缀 //调用动态库函数,生成打印号码的按键序列,不包括最后的确认! char keys[256] ={0}; terminal->GeneralBonusKeyStr(currentBonus->seq, keys); keysCount +=terminal->box->TypeInnerString(AnsiString(keys)); keysCount +=terminal->box->TypeInnerString(terminal->xmlConfig->Keyboard->BobusPostfix); //兑奖按键后缀,体彩是F1打印兑奖回执 return keysCount; }
void __fastcall TfrmFirma::Sil1Click(TObject *Sender) { int nDeger; nDeger = Application->MessageBox("Kaydý silmek istediðinize emin misiniz?", "Silme onayý", MB_YESNO + MB_ICONQUESTION); if (nDeger == IDYES) { tblYETKILI->Close(); queryYETKILISIL->Close(); queryYETKILISIL->SQL->Clear(); queryYETKILISIL->SQL->Add("DELETE FROM YETKILI"); queryYETKILISIL->SQL->Add("WHERE FIRMA_KODU="+FloatToStr(datamoduleORTEG->tblFIRMAFIRMA_KODU->Value)); queryYETKILISIL->ExecSQL(); datamoduleORTEG->tblFIRMA->Delete(); datamoduleORTEG->tblFIRMA->Close(); datamoduleORTEG->tblFIRMA->Filtered = false; } }
void MapEditor2D::WriteLightObjectData (LightObject *Obj, FILE *F) { fputs (string(" Radius : "+FloatToStr(Obj->Radius)+";\n").c_str(), F); if (Obj->Attenuation > 0.f) fputs (string(" Attenuation : "+FloatToStr(Obj->Attenuation)+";\n").c_str(), F); fputs (string(" Color : "+FloatToStr(Obj->Color.r)+"," +FloatToStr(Obj->Color.g)+"," +FloatToStr(Obj->Color.b)+"," +FloatToStr(Obj->Color.a)+";\n").c_str(), F); fputs (string(" LightType : " +IntToStr(Obj->Type)+";\n").c_str(), F); fputs (string(" CastShadow : "+IntToStr(Obj->CastShadow)+";\n").c_str(), F); }
void calculateVswr() { // Calculate VSWR only if fl_fwdpwr > 10 if (fl_fwdpwr > 10.0) { fl_vswr = fl_voltRfl / fl_voltFwd; fl_ratioPlus = 1.0 + fl_vswr; fl_ratioMinus = 1.0 - fl_vswr; fl_vswr = fl_ratioPlus / fl_ratioMinus; FloatToStr(fl_vswr, tmpString); // Pad VSWR string to 3 places; tmpString[3] = '\0'; if (tmpString[2] == '\0') { tmpString[2] = ' '; }; if (tmpString[1] == '\0') { tmpString[1] = ' '; }; // Update display only when VSWR changes. if (strcmp(VSWR_STR, tmpString)) { memcpy(VSWR_STR, tmpString, 3); tx_lcdFlag = 1; } } }
//--------------------------------------------------------------------------- void __fastcall TFormSceneInspectorForm::Button8Click(TObject *Sender) { if (imageSetLoaded && marchingCubesScene) { Word sHour, sMin, sSec, sMSec; TDateTime sPresent = Now(); DecodeTime(sPresent, sHour, sMin, sSec, sMSec); marchingCubesScene->marchTheCubes(); Word eHour, eMin, eSec, eMSec; TDateTime ePresent = Now(); DecodeTime(ePresent, eHour, eMin, eSec, eMSec); double start= ((sHour *60 + sMin) *60 + sSec) * 1000 + sMSec; double stop = ((eHour *60 + eMin) *60 + eSec) * 1000 + eMSec; Memo1->Lines->Add("Process took "+ FloatToStr(1.0*abs(stop-start)/1000) + " seconds."); marchingCubesScene->updateScene(); } }
//--------------------------------------------------------------------------- void __fastcall TForm1::Timer1Timer(TObject *Sender) { int I; TListViewItem *LItem; TMonitor::Enter(FLock); try { LvMonitoring->Items->Clear(); FList.Length = FCurrentBeaconList.Length; for (I = 0; I < FList.Length; I++) { if (FCurrentBeaconList[I]->ItsAlive()) { LItem = LvMonitoring->Items->Add(); LItem->Text = GUIDToString(FCurrentBeaconList[I]->GUID); LItem->Detail = "Major: " + IntToStr(FCurrentBeaconList[I]->Major)+ " Minor: " + IntToStr(FCurrentBeaconList[I]->Minor) + "Proximity: " + IntToStr(FCurrentBeaconList[I]->Proximity) + Char(13) + "Rssi: " + IntToStr(FCurrentBeaconList[I]->Rssi) + " Distance: " + FloatToStr(FCurrentBeaconList[I]->Distance); FList[I].FOriginalColor = TAlphaColorRec::Blue; FList[I].FDistance = FCurrentBeaconList[I]->Distance; FList[I].FName = GUIDToString(FCurrentBeaconList[I]->GUID) + ";" + IntToStr(FCurrentBeaconList[I]->Major) + ";" + IntToStr(FCurrentBeaconList[I]->Minor); switch (FCurrentBeaconList[I]->Proximity) { case TBeaconProximity::Inmediate: FList[I].FOriginalColor = TAlphaColorRec::Green; break; case TBeaconProximity::Near: FList[I].FOriginalColor = TAlphaColorRec::Yellow; break; case TBeaconProximity::Far: FList[I].FOriginalColor = TAlphaColorRec::Red; break; case TBeaconProximity::Away: FList[I].FOriginalColor = TAlphaColorRec::Black; break; }; }; }; BeaconsRectangle->Repaint(); } __finally { TMonitor::Exit(FLock); }; }
void checkTemperature(short force) { unsigned int tmp_temp = 0; float temperature; tmp_temp = ADC_READ(TEMP_CH); a_temp = (a_temp + tmp_temp) >> 1; temperature = a_temp * 4; temperature = temperature / 10; if (a_temp != last_atemp || force){ last_atemp = a_temp; if (tempmode == 0) { temperature = temperature * 1.8; temperature = temperature + 32; } FloatToStr(temperature, tmpString); memcpy(TEMP_STR, tmpString, 3); rx_lcdFlag = 1; } temperatureFlag = 0; }
void __fastcall TForm1::BeaconProximity(System::TObject* const Sender, const _di_IBeacon ABeacon, TBeaconProximity Proximity) { String LProximityText; TListViewItem *LNewitem; Integer I; switch (Proximity) { case TBeaconProximity::Inmediate: LProximityText = "Inmediate"; case TBeaconProximity::Near: LProximityText = "Near2"; case TBeaconProximity::Far: LProximityText = "Far"; case TBeaconProximity::Away: LProximityText = "Away"; }; LNewitem = LvProximity->Items->Add(); LNewitem->Text = GUIDToString(ABeacon->GUID); LNewitem->Detail = " Ma:" + IntToStr(ABeacon->Major) + " Mi:" + IntToStr(ABeacon->Minor) + " Dist:" + FloatToStr(ABeacon->Distance) + "Proximity: " + LProximityText + " time " + TimeToStr(Now()); for( I = 0; I < FList.Length; I++) { if ( FList[I].FName == (GUIDToString(ABeacon->GUID) + ";" + IntToStr(ABeacon->Major)+ ";" + IntToStr(ABeacon->Minor))) { switch (Proximity) { case TBeaconProximity::Inmediate: FList[I].FOriginalColor = TAlphaColorRec::Green; break; case TBeaconProximity::Near: FList[I].FOriginalColor = TAlphaColorRec::Yellow; break; case TBeaconProximity::Far: FList[I].FOriginalColor = TAlphaColorRec::Red; break; case TBeaconProximity::Away: FList[I].FOriginalColor = TAlphaColorRec::Black; break; }; break; }; }; };