]> Creatis software - creaRigidRegistration.git/blobdiff - PackRecalage/src/bbPackRecalageImageSwitcherBox.cxx
*** empty log message ***
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageImageSwitcherBox.cxx
index c5eee38fd2f570b769e6fc72512dd6737a57d11b..1c603f6c17b3b5cc2da47a47cd2490c4e7d5d43a 100644 (file)
@@ -14,8 +14,10 @@ namespace bbPackRecalage
        void MyTimer::Notify()
        {
                _box->Process();
+               _box->bbSignalOutputModification(std::string("Out")); 
        }
 
+
        
 
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,ImageSwitcherBox)
@@ -23,6 +25,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ImageSwitcherBox,bbtk::WxBlackBox);
 void ImageSwitcherBox::Process()
 {
        time = bbGetInputTime();
+       _on = bbGetInputOn();
                
        if(myTimer == NULL)
        {
@@ -30,12 +33,14 @@ void ImageSwitcherBox::Process()
                myTimer->Start(time);
                oldTime = time;
        }
-       else if(oldTime != time)
+       
+       if(oldTime != time && myTimer !=NULL)
        {
+               myTimer->Stop();
                myTimer->Start(time);
                oldTime = time;
        }
-
+       
        if(change == false)
        {
                bbSetOutputOut(bbGetInputIn1());
@@ -45,7 +50,7 @@ void ImageSwitcherBox::Process()
        {
                bbSetOutputOut(bbGetInputIn2());
                change = false;
-       }
+       }       
 }
 void ImageSwitcherBox::CreateWidget(wxWindow* parent)
 {
@@ -55,8 +60,9 @@ void ImageSwitcherBox::bbUserSetDefaultValues()
 {
        myTimer = NULL;
        change = false;
-       time = -1;
-       oldTime = -1;
+       time = 500;
+       oldTime = 500;
+       _on = false;
 }
 void ImageSwitcherBox::bbUserInitializeProcessing()
 {
@@ -68,4 +74,5 @@ void ImageSwitcherBox::bbUserFinalizeProcessing()
        delete myTimer;
 }
 }
-// EO namespace bbPackRecalage
\ No newline at end of file
+// EO namespace bbPackRecalage
+