From ab8b8af6ee0f8dc16f70cc2e2f9b724674208398 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 13 Jan 2022 11:16:21 +0100 Subject: [PATCH] #3483 adaptor from string to long and long to string --- packages/std/src/bbstdGetVectorPointer.h | 10 ++++++++-- packages/std/src/bbstdSharedMemory.cxx | 7 ++++--- packages/std/src/bbstdStringTo.cxx | 8 +++++++- packages/std/src/bbstdToString.cxx | 1 + packages/wx/src/bbwxComboBox.cxx | 4 +--- packages/wx/src/bbwxSlider.cxx | 6 +++++- 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/packages/std/src/bbstdGetVectorPointer.h b/packages/std/src/bbstdGetVectorPointer.h index 931dc66..7a6b607 100644 --- a/packages/std/src/bbstdGetVectorPointer.h +++ b/packages/std/src/bbstdGetVectorPointer.h @@ -50,9 +50,12 @@ namespace bbstd BBTK_TEMPLATE_BLACK_BOX_INTERFACE(GetVectorPointer,bbtk::AtomicBlackBox,T); BBTK_DECLARE_INPUT(In,std::vector); BBTK_DECLARE_OUTPUT(PVec,std::vector*); + BBTK_DECLARE_OUTPUT(Vec,std::vector); BBTK_PROCESS(DoIt); void DoIt(); std::vector vec; + + bool firsttime; }; //================================================================= @@ -69,6 +72,7 @@ namespace bbstd // BBTK_TEMPLATE_INPUT(GetVectorPointer, ErrorValue, "ErrorValue",T); // BBTK_TEMPLATE_OUTPUT(GetVectorPointer,Out,"Output",T); BBTK_TEMPLATE_OUTPUT(GetVectorPointer,PVec,"Output Pointer Vector",std::vector*); +BBTK_TEMPLATE_OUTPUT(GetVectorPointer,Vec,"Output Vector",std::vector); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorPointer); //================================================================= @@ -76,8 +80,10 @@ namespace bbstd template void GetVectorPointer::DoIt() { - vec = bbGetInputIn(); + if (firsttime==true) vec = bbGetInputIn(); + firsttime=false; bbSetOutputPVec( &vec ); + bbSetOutputVec( vec ); } //================================================================= @@ -85,7 +91,7 @@ namespace bbstd template void GetVectorPointer::bbUserSetDefaultValues() { - + firsttime=true; } //================================================================= //================================================================= diff --git a/packages/std/src/bbstdSharedMemory.cxx b/packages/std/src/bbstdSharedMemory.cxx index 5dfd30a..ea3383e 100644 --- a/packages/std/src/bbstdSharedMemory.cxx +++ b/packages/std/src/bbstdSharedMemory.cxx @@ -60,7 +60,8 @@ namespace bbstd // Get the name of the input which changed std::string input_name = c->GetConnection()->GetBlackBoxToInput(); // Set the output to the value of the input which changed - bbSetOutputOut( bbGetInput(input_name) ); + bbSetOutputOut( bbGetInput(input_name) ); + printf("EED SharedMemory::bbSetStatusAndPropagate input_name:%s \n",input_name.c_str() ); } // No more change allowed mCanSet = false; @@ -86,8 +87,8 @@ namespace bbstd { firsttime = false; bbSetOutputOut( bbGetInputIn() ); - } - } + } // if firsttime +} BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,SharedMemory); BBTK_BLACK_BOX_IMPLEMENTATION(SharedMemory,bbtk::AtomicBlackBox); diff --git a/packages/std/src/bbstdStringTo.cxx b/packages/std/src/bbstdStringTo.cxx index 052b6b3..09de441 100644 --- a/packages/std/src/bbstdStringTo.cxx +++ b/packages/std/src/bbstdStringTo.cxx @@ -113,7 +113,12 @@ namespace bbstd { bbSetOutputOut( atof ( bbGetInputIn().c_str() ) ); } - + + template <> void StringTo ::DoIt() + { + bbSetOutputOut( (long)atoi ( bbGetInputIn().c_str() ) ); + } + //==================================================================== //==================================================================== @@ -128,6 +133,7 @@ namespace bbstd BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,StringTo,uint32_t); BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,StringTo,float); BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,StringTo,double); + BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,StringTo,long); BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,StringTo,Void); //==================================================================== diff --git a/packages/std/src/bbstdToString.cxx b/packages/std/src/bbstdToString.cxx index ee386ef..5b2f13f 100644 --- a/packages/std/src/bbstdToString.cxx +++ b/packages/std/src/bbstdToString.cxx @@ -67,6 +67,7 @@ namespace bbstd BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,ToString,uint32_t); BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,ToString,float); BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,ToString,double); + BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,ToString,long); //==================================================================== diff --git a/packages/wx/src/bbwxComboBox.cxx b/packages/wx/src/bbwxComboBox.cxx index fe33889..d081d32 100644 --- a/packages/wx/src/bbwxComboBox.cxx +++ b/packages/wx/src/bbwxComboBox.cxx @@ -4,7 +4,6 @@ #include "bbwxComboBox.h" #include "bbwxPackage.h" - #include #include @@ -58,8 +57,7 @@ namespace bbwx int typeForm, int sizeX, int sizeY - ) - : + ) : wxPanel( parent, -1,wxDefaultPosition ) , mBox(box), mTypeForm(typeForm) diff --git a/packages/wx/src/bbwxSlider.cxx b/packages/wx/src/bbwxSlider.cxx index 0db2b07..eae91e7 100644 --- a/packages/wx/src/bbwxSlider.cxx +++ b/packages/wx/src/bbwxSlider.cxx @@ -151,6 +151,10 @@ namespace bbwx wxorientation = wxSL_VERTICAL; } + + wxSize sizeSliderWidget(25,25); +// int widthSliderWidget = wxDefaultSize; + //--------------------------------------------------------------------- // 1) Creation of the components of the widget // Any top level sub-widget must have the panel returned by panel @@ -158,7 +162,7 @@ namespace bbwx mwxSlider = new wxSlider( panel, -1, 0 , 0, 500 , wxDefaultPosition, - wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); + sizeSliderWidget, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); // mwxSlider->SetInitialSize(wxSize(sizeX,sizeY)); -- 2.47.1