void SettingsPanel::onSliderLaserOutput( Gwen::Controls::Base* pControl ){ Gwen::Controls::Label* label = mLabelsMap[pControl]; Gwen::Controls::Slider* pSlider = ( Gwen::Controls::Slider* ) pControl; label->SetValue( toString(( int ) pSlider->GetFloatValue())); // console() << label->GetValue().c_str() << " Slider Value: " << ( float ) pSlider->GetFloatValue() << std::endl; string controlName = pSlider->GetName().c_str(); if (controlName.compare("Target Points Count") == 0){ mIldaFrame->params.output.targetPointCount = ( int ) pSlider->GetFloatValue(); mIldaFrame->update(); } else if (controlName.compare("Blank Count") == 0){ mIldaFrame->params.output.blankCount = ( int ) pSlider->GetFloatValue(); mIldaFrame->update(); } else if (controlName.compare("End Count") == 0){ mIldaFrame->params.output.endCount = ( int ) pSlider->GetFloatValue(); mIldaFrame->update(); } else if (controlName.compare("Laser pps") == 0){ mLaserController->setPPS(( int ) pSlider->GetFloatValue()); } else if (controlName.compare("Laser Angle") == 0){ mLaserPreview3D->setLaserAngle( ( int ) pSlider->GetFloatValue() ); } else if (controlName.compare("Scanner Angle Max Input") == 0){ float scale = pSlider->GetFloatValue()/(mIldaFrame->params.output.scannerAngleX); // float val = mIldaFrame->params.output.transform.scale.x * mIldaFrame->params.output.scannerAngleX * 100; mIldaFrame->params.output.transform.scale.x = scale; mIldaFrame->params.output.transform.scale.y = scale; } else if(controlName.compare("Fans Intensity") == 0){ mLaserPreview3D->paramsView.fansIntensity = ( float ) pSlider->GetFloatValue() / 100.0; } else if(controlName.compare("Main speed") == 0){ mMainController->getDataManager()->setMainSpeed( ( float ) ((int)pSlider->GetFloatValue())/100.0 ); } }
void SliderMoved( Base* pControl ) { Gwen::Controls::Slider* pSlider = (Gwen::Controls::Slider*)pControl; UnitPrint( Utility::Format( L"Slider Value: %.2f", (float)pSlider->GetFloatValue() ) ); }