Index: trunk/demos/CircleFollower/simulator/build_x86_64/bin/setup_x4.xml
===================================================================
--- trunk/demos/CircleFollower/simulator/build_x86_64/bin/setup_x4.xml	(revision 156)
+++ trunk/demos/CircleFollower/simulator/build_x86_64/bin/setup_x4.xml	(revision 157)
@@ -40,5 +40,5 @@
     </GroupBox>
     <DoubleSpinBox value="6" name="range:"/>
-   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
+   <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.0400000000000000"/><Vector3DSpinBox name="direction" value_x="0" value_y="0" value_z="1"/></Tab>
    <Tab name="bottom camera">
     <GroupBox name="position">
Index: trunk/demos/Sinus/src/MeanFilter.cpp
===================================================================
--- trunk/demos/Sinus/src/MeanFilter.cpp	(revision 156)
+++ trunk/demos/Sinus/src/MeanFilter.cpp	(revision 157)
@@ -46,4 +46,6 @@
 
   AddDataToLog(output);
+  
+  SetIsReady(true);
 }
 
Index: trunk/demos/Sinus/src/Sinus.cpp
===================================================================
--- trunk/demos/Sinus/src/Sinus.cpp	(revision 156)
+++ trunk/demos/Sinus/src/Sinus.cpp	(revision 157)
@@ -64,4 +64,6 @@
       settingsTab->NewRow(),
       "setup"); // layout sui servira à placer des filtres par exemple
+      
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairCore/src/Euler.cpp
===================================================================
--- trunk/lib/FlairCore/src/Euler.cpp	(revision 156)
+++ trunk/lib/FlairCore/src/Euler.cpp	(revision 157)
@@ -113,6 +113,7 @@
     rot2 = yaw - angle;
   }
-  if (rot2 < rot1)
-    rot1 = -rot2;
+  
+  if (rot2 < rot1) rot1 = -rot2;
+  
   rot1 = -rot1; // pour avoir rot1=yaw-angle
 
Index: trunk/lib/FlairCore/src/FindArgument.cpp
===================================================================
--- trunk/lib/FlairCore/src/FindArgument.cpp	(revision 157)
+++ trunk/lib/FlairCore/src/FindArgument.cpp	(revision 157)
@@ -0,0 +1,19 @@
+#include "FindArgument.h"
+
+std::string FindArgument(std::string args,std::string arg,bool recquired) {
+	size_t position=args.find (arg);
+	
+	if(position!=std::string::npos) {
+		size_t endPosition=args.find(" ",position);
+		size_t len;
+		if(endPosition!=std::string::npos) {
+			len=endPosition-position-arg.size();
+		} else {
+			len=std::string::npos;
+		}
+		return args.substr(position+arg.size(),len);
+	} else {
+		if(recquired) printf("no %s statement in arguments (%s)\n",arg.c_str(),args.c_str());
+		return "";
+	}
+}
Index: trunk/lib/FlairCore/src/FindArgument.h
===================================================================
--- trunk/lib/FlairCore/src/FindArgument.h	(revision 157)
+++ trunk/lib/FlairCore/src/FindArgument.h	(revision 157)
@@ -0,0 +1,8 @@
+#ifndef FINDARGUMENT
+#define FINDARGUMENT
+
+#include <string>
+
+std::string FindArgument(std::string args,std::string arg,bool recquired);
+
+#endif // FINDARGUMENT
Index: trunk/lib/FlairCore/src/IODevice.cpp
===================================================================
--- trunk/lib/FlairCore/src/IODevice.cpp	(revision 156)
+++ trunk/lib/FlairCore/src/IODevice.cpp	(revision 157)
@@ -64,4 +64,12 @@
 DataType const &IODevice::GetOutputDataType() const { return dummyType; }
 
+void IODevice::SetIsReady(bool status) {
+  pimpl_->SetIsReady(status);
+}
+
+bool IODevice::IsReady(void) const {
+  return pimpl_->IsReady();
+}
+
 } // end namespace core
 } // end namespace flair
Index: trunk/lib/FlairCore/src/IODevice.h
===================================================================
--- trunk/lib/FlairCore/src/IODevice.h	(revision 156)
+++ trunk/lib/FlairCore/src/IODevice.h	(revision 157)
@@ -110,4 +110,14 @@
   */
   void OutputToShMem(bool enabled);
+  
+  /*!
+  * \brief is device ready
+  *
+  * Use it check if a device is ready or not.
+  * See also setIsReady.
+  *
+  * \return true if device is ready
+  */
+  bool IsReady(void) const;
 
   // TODO: these 2 method should be pure virtual
@@ -115,19 +125,29 @@
   virtual DataType const &GetOutputDataType() const;
 
-        protected:
-            /*!
-            * \brief Process the childs of type IODevice, and log if needed
-            *
-            * This method must be called after computing datas;
-            * generally at the end of the reimplemented UpdateFrom or after acquiring datas in case of a sensor. \n
-            * It will call UpdateFrom methods of each child of type IODevice,
-            * and log all datas (this IODevice and its childs)
-            * if logging is enabled (see SetDataToLog(), AddDeviceToLog(),
-            * FrameworkManager::StartLog and FrameworkManager::AddDeviceToLog). \n
-            * If a thread is waiting on this IODevice (see Thread::WaitUpdate), it will be resumed.
-            *
-            * \param data data to process
-            */
-            void ProcessUpdate(io_data* data);
+  protected:
+    /*!
+    * \brief Process the childs of type IODevice, and log if needed
+    *
+    * This method must be called after computing datas;
+    * generally at the end of the reimplemented UpdateFrom or after acquiring datas in case of a sensor. \n
+    * It will call UpdateFrom methods of each child of type IODevice,
+    * and log all datas (this IODevice and its childs)
+    * if logging is enabled (see SetDataToLog(), AddDeviceToLog(),
+    * FrameworkManager::StartLog and FrameworkManager::AddDeviceToLog). \n
+    * If a thread is waiting on this IODevice (see Thread::WaitUpdate), it will be resumed.
+    *
+    * \param data data to process
+    */
+    void ProcessUpdate(io_data* data);
+    
+    /*!
+    * \brief set is ready
+    *
+    * Sets if the device is ready or not. By default the IODevice is not ready.\n
+    * See also isReady.
+    *
+    * \param status status
+    */
+    void SetIsReady(bool status);
 
 private:
Index: trunk/lib/FlairCore/src/IODevice_impl.cpp
===================================================================
--- trunk/lib/FlairCore/src/IODevice_impl.cpp	(revision 156)
+++ trunk/lib/FlairCore/src/IODevice_impl.cpp	(revision 157)
@@ -39,4 +39,5 @@
   tobelogged = false;
   outputtoshm = false;
+  isReady=false;
 }
 
@@ -233,2 +234,10 @@
   return status;
 }
+
+void IODevice_impl::SetIsReady(bool status) {
+  isReady=status;
+}
+
+bool IODevice_impl::IsReady(void) const {
+  return isReady;
+}
Index: trunk/lib/FlairCore/src/ui_com.cpp
===================================================================
--- trunk/lib/FlairCore/src/ui_com.cpp	(revision 156)
+++ trunk/lib/FlairCore/src/ui_com.cpp	(revision 157)
@@ -278,6 +278,5 @@
       if (offset != 3) {
         memcpy(&send_buffer[1], &resume_period, sizeof(uint16_t));
-        // printf("send %i %i %i %x
-        // %x\n",resume_period,offset,sizeof(uint16_t),send_buffer,&send_buffer[1]);
+        // printf("send %i %i %i %x %x\n",resume_period,offset,sizeof(uint16_t),send_buffer,&send_buffer[1]);
         // for(int i=0;i<offset;i++) printf("%x ",send_buffer[i]);
         // printf("\n");
@@ -292,11 +291,11 @@
       }
       send_mutex->ReleaseMutex();
-      // Printf("%i %lld\n",resume_period,GetTime()/1000000);
+      //Printf("%i %lld\n",resume_period,GetTime()/1000000);
     } else {
       send_mutex->ReleaseMutex();
       // rien a faire, suspend
-      // Printf("rien a faire suspend\n");
+      //Printf("rien a faire suspend\n");
       Suspend();
-      // Printf("wake\n");
+      //Printf("wake\n");
       // on planifie la prochaine execution
       Time time = GetTime();
Index: trunk/lib/FlairCore/src/unexported/IODevice_impl.h
===================================================================
--- trunk/lib/FlairCore/src/unexported/IODevice_impl.h	(revision 156)
+++ trunk/lib/FlairCore/src/unexported/IODevice_impl.h	(revision 157)
@@ -47,4 +47,6 @@
   void WriteToShMem(void);
   void PrintLogsDescriptors(void);
+  void SetIsReady(bool status);
+  bool IsReady(void) const;
 
 private:
@@ -59,4 +61,5 @@
   bool outputtoshm;
   flair::core::SharedMem *shmem;
+  bool isReady;
 };
 
Index: trunk/lib/FlairFilter/src/AhrsComplementaryFilter.cpp
===================================================================
--- trunk/lib/FlairFilter/src/AhrsComplementaryFilter.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/AhrsComplementaryFilter.cpp	(revision 157)
@@ -51,5 +51,6 @@
     kb[1]=new DoubleSpinBox(parent->GetLayout()->LastRowLastCol(),"kb[1]:",0.,10,0.1,2,0.01);
     kb[2]=new DoubleSpinBox(parent->GetLayout()->LastRowLastCol(),"kb[2]:",0.,10,0.1,2,0.01);
-
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/AhrsKalman.cpp
===================================================================
--- trunk/lib/FlairFilter/src/AhrsKalman.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/AhrsKalman.cpp	(revision 157)
@@ -31,4 +31,6 @@
     GetDatas(&ahrsData);
     pimpl_=new AhrsKalman_impl(parent->GetLayout(),ahrsData);
+    
+    SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/ButterworthLowPass.cpp
===================================================================
--- trunk/lib/FlairFilter/src/ButterworthLowPass.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/ButterworthLowPass.cpp	(revision 157)
@@ -35,4 +35,6 @@
   pimpl_ = new ButterworthLowPass_impl(this, position, name, order);
   AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/EulerDerivative.cpp
===================================================================
--- trunk/lib/FlairFilter/src/EulerDerivative.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/EulerDerivative.cpp	(revision 157)
@@ -34,4 +34,6 @@
   pimpl_ = new EulerDerivative_impl(this, position, name, init_value);
   AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/Gx3_25_ahrs.cpp
===================================================================
--- trunk/lib/FlairFilter/src/Gx3_25_ahrs.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/Gx3_25_ahrs.cpp	(revision 157)
@@ -30,9 +30,10 @@
                          SerialPort *serialport, Gx3_25_imu::Command_t command,
                          uint8_t priority)
-    : Ahrs(new Gx3_25_imu( name, serialport, command, priority), name) {}
+    : Ahrs(new Gx3_25_imu( name, serialport, command, priority), name) {
+
+  SetIsReady(true);
+}
 
 Gx3_25_ahrs::~Gx3_25_ahrs() {}
-
-void Gx3_25_ahrs::Start(void) { ((Gx3_25_imu *)GetImu())->Start(); }
 
 // datas from Gx3_25_imu are AhrsData!
Index: trunk/lib/FlairFilter/src/Gx3_25_ahrs.h
===================================================================
--- trunk/lib/FlairFilter/src/Gx3_25_ahrs.h	(revision 156)
+++ trunk/lib/FlairFilter/src/Gx3_25_ahrs.h	(revision 157)
@@ -47,10 +47,4 @@
   ~Gx3_25_ahrs();
 
-  /*!
-  * \brief Start Gx3_25_imu Thread
-  *
-  */
-  void Start(void);
-
 private:
   /*!
Index: trunk/lib/FlairFilter/src/JoyReference.cpp
===================================================================
--- trunk/lib/FlairFilter/src/JoyReference.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/JoyReference.cpp	(revision 157)
@@ -37,4 +37,6 @@
   AddDataToLog(pimpl_->output);
   AddDataToLog(pimpl_->ahrsData);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/LowPassFilter.cpp
===================================================================
--- trunk/lib/FlairFilter/src/LowPassFilter.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/LowPassFilter.cpp	(revision 157)
@@ -34,4 +34,6 @@
   pimpl_ = new LowPassFilter_impl(this, position, name, init_value);
   AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/NestedSat.cpp
===================================================================
--- trunk/lib/FlairFilter/src/NestedSat.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/NestedSat.cpp	(revision 157)
@@ -33,4 +33,6 @@
     : ControlLaw(position->getLayout(), name) {
   pimpl_ = new NestedSat_impl(this, position, name);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/Pid.cpp
===================================================================
--- trunk/lib/FlairFilter/src/Pid.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/Pid.cpp	(revision 157)
@@ -32,4 +32,6 @@
     : ControlLaw(position->getLayout(), name) {
   pimpl_ = new Pid_impl(this, position, name);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/PidThrust.cpp
===================================================================
--- trunk/lib/FlairFilter/src/PidThrust.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/PidThrust.cpp	(revision 157)
@@ -33,4 +33,6 @@
     : ControlLaw(position->getLayout(), name) {
   pimpl_ = new PidThrust_impl(this, position, name);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/SimuAhrs.cpp
===================================================================
--- trunk/lib/FlairFilter/src/SimuAhrs.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/SimuAhrs.cpp	(revision 157)
@@ -29,9 +29,9 @@
 SimuAhrs::SimuAhrs(string name, uint32_t dev_id,
                    uint8_t priority)
-    : Ahrs(new SimuImu(name, dev_id, priority), name) {}
+    : Ahrs(new SimuImu(name, dev_id, priority), name) {
+  SetIsReady(true);
+}
 
 SimuAhrs::~SimuAhrs() {}
-
-void SimuAhrs::Start(void) { ((SimuImu *)GetImu())->Start(); }
 
 // datas from SimuImu are AhrsData!
Index: trunk/lib/FlairFilter/src/SimuAhrs.h
===================================================================
--- trunk/lib/FlairFilter/src/SimuAhrs.h	(revision 156)
+++ trunk/lib/FlairFilter/src/SimuAhrs.h	(revision 157)
@@ -45,10 +45,4 @@
   ~SimuAhrs();
 
-  /*!
- * \brief Start SimuImu Thread
- *
- */
-  void Start(void);
-
 private:
   /*!
Index: trunk/lib/FlairFilter/src/TrajectoryGenerator1D.cpp
===================================================================
--- trunk/lib/FlairFilter/src/TrajectoryGenerator1D.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/TrajectoryGenerator1D.cpp	(revision 157)
@@ -34,4 +34,5 @@
   pimpl_ = new TrajectoryGenerator1D_impl(this, position, name, unit);
   AddDataToLog(pimpl_->output);
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp
===================================================================
--- trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp	(revision 157)
@@ -35,4 +35,5 @@
   pimpl_ = new TrajectoryGenerator2DCircle_impl(this, position, name);
   AddDataToLog(pimpl_->output);
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairFilter/src/X4X8Multiplex.cpp
===================================================================
--- trunk/lib/FlairFilter/src/X4X8Multiplex.cpp	(revision 156)
+++ trunk/lib/FlairFilter/src/X4X8Multiplex.cpp	(revision 157)
@@ -47,4 +47,6 @@
     SetMultiplexComboBox(pimpl_->MotorName(i), i);
   }
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairMeta/src/HdsX8.cpp
===================================================================
--- trunk/lib/FlairMeta/src/HdsX8.cpp	(revision 156)
+++ trunk/lib/FlairMeta/src/HdsX8.cpp	(revision 157)
@@ -35,5 +35,5 @@
 namespace meta {
 
-HdsX8::HdsX8(string name,
+HdsX8::HdsX8(string name,string options,
              filter::UavMultiplex *multiplex)
     : Uav(name, multiplex) {
@@ -56,9 +56,13 @@
 
 void HdsX8::StartSensors(void) {
-  ((Gx3_25_ahrs *)GetAhrs())->Start();
+  ((Gx3_25_imu *)(GetAhrs()->GetImu()))->Start();
   ((Srf08 *)GetUsRangeFinder())->Start();
   ((Ps3Eye *)GetVerticalCamera())->Start();
 }
 
+bool HdsX8::isReadyToFly(void) const {
+  return GetAhrs()->GetImu()->IsReady();
+}
+
 } // end namespace meta
 } // end namespace flair
Index: trunk/lib/FlairMeta/src/HdsX8.h
===================================================================
--- trunk/lib/FlairMeta/src/HdsX8.h	(revision 156)
+++ trunk/lib/FlairMeta/src/HdsX8.h	(revision 157)
@@ -24,9 +24,10 @@
 class HdsX8 : public Uav {
 public:
-  HdsX8(std::string name,
+  HdsX8(std::string name,std::string options="",
         filter::UavMultiplex *multiplex = NULL);
   ~HdsX8();
   void StartSensors(void);
 	std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";}
+  bool isReadyToFly(void) const;
 
 private:
Index: trunk/lib/FlairMeta/src/MetaDualShock3.cpp
===================================================================
--- trunk/lib/FlairMeta/src/MetaDualShock3.cpp	(revision 156)
+++ trunk/lib/FlairMeta/src/MetaDualShock3.cpp	(revision 157)
@@ -42,4 +42,6 @@
   getFrameworkManager()->AddDeviceToLog(pimpl_->joy_ref);
   controller->Start();
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairMeta/src/SimuX4.cpp
===================================================================
--- trunk/lib/FlairMeta/src/SimuX4.cpp	(revision 156)
+++ trunk/lib/FlairMeta/src/SimuX4.cpp	(revision 157)
@@ -26,4 +26,5 @@
 #include <BatteryMonitor.h>
 #include <Tab.h>
+#include <FindArgument.h>
 
 using std::string;
@@ -37,5 +38,5 @@
 namespace meta {
 
-SimuX4::SimuX4(string name, int simu_id,
+SimuX4::SimuX4(string name, int simu_id,string options,
                filter::UavMultiplex *multiplex)
     : Uav(name, multiplex) {
@@ -51,6 +52,13 @@
   SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
   GetBatteryMonitor()->SetBatteryValue(12);
+  
+  string camvOpts=FindArgument(options,"camv=",false);
+  uint16_t camvWidth=320,camvHeight=240;
+	if(camvOpts=="") {
+    Info("using default vertical camera resolution: %ix%i\n",camvWidth, camvHeight);
+	}
+  
   SetVerticalCamera(
-      new SimuCamera("simu_cam_v", 320, 240, 3, simu_id, 10));
+      new SimuCamera("simu_cam_v", camvWidth, camvHeight, 3, simu_id, 10));
 }
 
@@ -58,9 +66,10 @@
 
 void SimuX4::StartSensors(void) {
-  ((SimuAhrs *)GetAhrs())->Start();
+  ((SimuImu *)(GetAhrs()->GetImu()))->Start();
   ((SimuUs *)GetUsRangeFinder())->Start();
   ((SimuCamera *)GetVerticalCamera())->Start();
 }
 
+
 } // end namespace meta
 } // end namespace flair
Index: trunk/lib/FlairMeta/src/SimuX4.h
===================================================================
--- trunk/lib/FlairMeta/src/SimuX4.h	(revision 156)
+++ trunk/lib/FlairMeta/src/SimuX4.h	(revision 157)
@@ -26,5 +26,5 @@
   // simu_id: 0 if simulating only one UAV
   //>0 otherwise
-  SimuX4(std::string name, int simu_id = 0,
+  SimuX4(std::string name, int simu_id = 0,std::string options="",
          filter::UavMultiplex *multiplex = NULL);
   ~SimuX4();
Index: trunk/lib/FlairMeta/src/SimuX8.cpp
===================================================================
--- trunk/lib/FlairMeta/src/SimuX8.cpp	(revision 156)
+++ trunk/lib/FlairMeta/src/SimuX8.cpp	(revision 157)
@@ -37,5 +37,5 @@
 namespace meta {
 
-SimuX8::SimuX8(string name, int simu_id,
+SimuX8::SimuX8(string name, int simu_id,string options,
                filter::UavMultiplex *multiplex)
     : Uav(name, multiplex) {
@@ -58,5 +58,5 @@
 
 void SimuX8::StartSensors(void) {
-  ((SimuAhrs *)GetAhrs())->Start();
+  ((SimuImu *)(GetAhrs()->GetImu()))->Start();
   ((SimuUs *)GetUsRangeFinder())->Start();
   ((SimuCamera *)GetVerticalCamera())->Start();
Index: trunk/lib/FlairMeta/src/SimuX8.h
===================================================================
--- trunk/lib/FlairMeta/src/SimuX8.h	(revision 156)
+++ trunk/lib/FlairMeta/src/SimuX8.h	(revision 157)
@@ -26,5 +26,5 @@
   // simu_id: 0 if simulating only one UAV
   //>0 otherwise
-  SimuX8(std::string name, int simu_id = 0,
+  SimuX8(std::string name, int simu_id = 0,std::string options="",
          filter::UavMultiplex *multiplex = NULL);
   ~SimuX8();
Index: trunk/lib/FlairMeta/src/Uav.h
===================================================================
--- trunk/lib/FlairMeta/src/Uav.h	(revision 156)
+++ trunk/lib/FlairMeta/src/Uav.h	(revision 157)
@@ -15,4 +15,5 @@
 
 #include <Object.h>
+#include <UsRangeFinder.h>
 
 namespace flair {
@@ -62,4 +63,5 @@
   sensor::Camera *GetHorizontalCamera(void) const;
 	virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
+  virtual bool isReadyToFly(void) const { return true;}
 
 protected:
Index: trunk/lib/FlairMeta/src/UavFactory.cpp
===================================================================
--- trunk/lib/FlairMeta/src/UavFactory.cpp	(revision 156)
+++ trunk/lib/FlairMeta/src/UavFactory.cpp	(revision 157)
@@ -30,5 +30,5 @@
 
 namespace { // anonymous
-     vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)> *vectoroffunctions=NULL;
+     vector<flair::meta::Uav* (*)(string,string,string,UavMultiplex*)> *vectoroffunctions=NULL;
 }
 
@@ -41,5 +41,5 @@
 
 
-Uav *CreateUav(string name, string uav_type,
+Uav *CreateUav(string name, string type,string options,
                UavMultiplex *multiplex) {
 
@@ -48,5 +48,5 @@
   if(vectoroffunctions!=NULL) {
     for(int i=0;i<vectoroffunctions->size();i++) {
-      uav=vectoroffunctions->at(i)(name,uav_type,multiplex);
+      uav=vectoroffunctions->at(i)(name,type,options,multiplex);
       if(uav!=NULL) {
         free(vectoroffunctions);
@@ -57,35 +57,34 @@
   }
 
-  if (uav_type == "hds_x4") {
-    getFrameworkManager()->Err("UAV type %s not yet implemented\n", uav_type.c_str());
+  if (type == "hds_x4") {
+    getFrameworkManager()->Err("UAV type %s not yet implemented\n", type.c_str());
     return NULL;
-  } else if (uav_type == "hds_x8") {
-    return new HdsX8(name, multiplex);
-  } else if (uav_type == "xair") {
-    return new XAir(name, multiplex);
-  } else if (uav_type == "hds_xufo") {
-    getFrameworkManager()->Err("UAV type %s not yet implemented\n", uav_type.c_str());
+  } else if (type == "hds_x8") {
+    return new HdsX8(name,options, multiplex);
+  } else if (type == "xair") {
+    return new XAir(name,options, multiplex);
+  } else if (type == "hds_xufo") {
+    getFrameworkManager()->Err("UAV type %s not yet implemented\n", type.c_str());
     return NULL;
-  } else if (uav_type.compare(0, 7, "x4_simu") == 0) {
+  } else if (type.compare(0, 7, "x4_simu") == 0) {
     int simu_id = 0;
-    if (uav_type.size() > 7) {
-      simu_id = atoi(uav_type.substr(7, uav_type.size() - 7).c_str());
+    if (type.size() > 7) {
+      simu_id = atoi(type.substr(7, type.size() - 7).c_str());
     }
-    return new SimuX4(name, simu_id, multiplex);
-  } else if (uav_type.compare(0, 7, "x8_simu") == 0) {
+    return new SimuX4(name, simu_id,options, multiplex);
+  } else if (type.compare(0, 7, "x8_simu") == 0) {
     int simu_id = 0;
-    if (uav_type.size() > 7) {
-      simu_id = atoi(uav_type.substr(7, uav_type.size() - 7).c_str());
+    if (type.size() > 7) {
+      simu_id = atoi(type.substr(7, type.size() - 7).c_str());
     }
-    return new SimuX8(name, simu_id, multiplex);
+    return new SimuX8(name, simu_id,options, multiplex);
   } else {
-    getFrameworkManager()->Err("UAV type %s unknown\n", uav_type.c_str());
+    getFrameworkManager()->Err("UAV type %s unknown\n", type.c_str());
     return NULL;
   }
 }
 
-void RegisterUavCreator(flair::meta::Uav*(*func)(string name, string type,
-               UavMultiplex *multiplex)) {
-  if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)>));
+void RegisterUavCreator(flair::meta::Uav*(*func)(string,string,string,UavMultiplex*)) {
+  if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(string,string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(string,string,string,UavMultiplex*)>));
 
   vectoroffunctions->push_back(func);
Index: trunk/lib/FlairMeta/src/UavFactory.h
===================================================================
--- trunk/lib/FlairMeta/src/UavFactory.h	(revision 156)
+++ trunk/lib/FlairMeta/src/UavFactory.h	(revision 157)
@@ -21,8 +21,8 @@
 #include <Uav.h>
 
-flair::meta::Uav *CreateUav(std::string name, std::string type,
+flair::meta::Uav *CreateUav(std::string name, std::string type,std::string options="",
                             flair::filter::UavMultiplex *multiplex = NULL);
 
-void RegisterUavCreator(flair::meta::Uav*(*func)(std::string name, std::string type,
-                                   flair::filter::UavMultiplex *multiplex));
+void RegisterUavCreator(flair::meta::Uav*(*func)(std::string,std::string,std::string,
+                                   flair::filter::UavMultiplex*));
 #endif // UAVFACTORY
Index: trunk/lib/FlairMeta/src/UavStateMachine.cpp
===================================================================
--- trunk/lib/FlairMeta/src/UavStateMachine.cpp	(revision 156)
+++ trunk/lib/FlairMeta/src/UavStateMachine.cpp	(revision 157)
@@ -460,11 +460,11 @@
   flagZTrajectoryFinished = false;
 
-    if((altitudeState==AltitudeState_t::Stopped) && safeToFly) {// && GetBatteryMonitor()->IsBatteryLow()==false)
-        //The uav always takes off in fail safe mode
-        EnterFailSafeMode();
-        joy->SetLedOFF(4);//DualShock3::led4
-        joy->SetLedOFF(1);//DualShock3::led1
-        joy->Rumble(0x70);
-        joy->SetZRef(0);
+  if((altitudeState==AltitudeState_t::Stopped) && safeToFly && uav->isReadyToFly()) {// && GetBatteryMonitor()->IsBatteryLow()==false)
+    //The uav always takes off in fail safe mode
+    EnterFailSafeMode();
+    joy->SetLedOFF(4);//DualShock3::led4
+    joy->SetLedOFF(1);//DualShock3::led1
+    joy->Rumble(0x70);
+    joy->SetZRef(0);
 
     uZ->SetOffset(); // positionne l'offset de compensation de la gravité à sa
@@ -481,4 +481,5 @@
     SignalEvent(Event_t::TakingOff);
   } else {
+    Warn("cannot takeoff\n");
     joy->ErrorNotify();
   }
Index: trunk/lib/FlairMeta/src/XAir.cpp
===================================================================
--- trunk/lib/FlairMeta/src/XAir.cpp	(revision 156)
+++ trunk/lib/FlairMeta/src/XAir.cpp	(revision 157)
@@ -38,5 +38,5 @@
 namespace meta {
 
-XAir::XAir(string name,
+XAir::XAir(string name, string options,
            filter::UavMultiplex *multiplex)
     : Uav(name, multiplex) {
@@ -61,9 +61,13 @@
 
 void XAir::StartSensors(void) {
-  ((Gx3_25_ahrs *)GetAhrs())->Start();
+  ((Gx3_25_imu *)(GetAhrs()->GetImu()))->Start();
   ((Srf08 *)GetUsRangeFinder())->Start();
   ((Ps3Eye *)GetVerticalCamera())->Start();
 }
 
+bool XAir::isReadyToFly(void) const {
+  return GetAhrs()->GetImu()->IsReady();
+}
+
 } // end namespace meta
 } // end namespace flair
Index: trunk/lib/FlairMeta/src/XAir.h
===================================================================
--- trunk/lib/FlairMeta/src/XAir.h	(revision 156)
+++ trunk/lib/FlairMeta/src/XAir.h	(revision 157)
@@ -24,9 +24,10 @@
 class XAir : public Uav {
 public:
-  XAir(std::string name,
+  XAir(std::string name,std::string options="",
        filter::UavMultiplex *multiplex = NULL);
   ~XAir();
   void StartSensors(void);
 	std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";}
+  bool isReadyToFly(void) const;
 
 private:
Index: trunk/lib/FlairSensorActuator/src/AfroBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/AfroBldc.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/AfroBldc.cpp	(revision 157)
@@ -37,4 +37,6 @@
     : Bldc(parent, layout, name, motors_count) {
   pimpl_ = new AfroBldc_impl(this, layout, i2cport);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/BlCtrlV2.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/BlCtrlV2.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/BlCtrlV2.cpp	(revision 157)
@@ -38,4 +38,6 @@
     : Bldc(parent, layout, name, motors_count) {
   pimpl_ = new BlCtrlV2_impl(this, layout, i2cport);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp	(revision 157)
@@ -134,4 +134,6 @@
   delete desc;
   
+  SetIsReady(true);
+  
   /*
 
Index: trunk/lib/FlairSensorActuator/src/Bldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Bldc.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/Bldc.cpp	(revision 157)
@@ -61,4 +61,6 @@
     : IODevice(parent, name) {
   pimpl_ = new Bldc_impl(this, motors_count);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/Camera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Camera.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/Camera.cpp	(revision 157)
@@ -50,4 +50,5 @@
   setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
   setup_layout = new GridLayout(sensor_tab->NewRow(), "setup");
+  
 }
 
Index: trunk/lib/FlairSensorActuator/src/EmulatedController.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/EmulatedController.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/EmulatedController.cpp	(revision 157)
@@ -30,4 +30,5 @@
 EmulatedController::EmulatedController(string name,uint8_t priority) :
     TargetController(name,priority) {
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp	(revision 157)
@@ -96,4 +96,5 @@
   SamplingSettings();
   GyrosBias();
+  self->SetIsReady(true);
   // RealignUpNorth(true,true);
 
@@ -265,6 +266,5 @@
     ssize_t written = 0;
 
-    Printf("Gx3_25_imu::gyros_bias: %s\n",
-           self->IODevice::ObjectName().c_str());
+    Printf("Gx3_25_imu::calibrating gyros, do not move imu\n");
 
     command[0] = 0xcd; // entete
@@ -296,6 +296,5 @@
     }
 
-    Printf("Gx3_25_imu::gyros_bias: %s ok\n",
-           self->IODevice::ObjectName().c_str());
+    Printf("Gx3_25_imu::calibration done\n");
 
   } else {
Index: trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp	(revision 157)
@@ -50,4 +50,6 @@
   this->serialport = serialport;
   serialport->SetRxTimeout(100000000);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/Mb800.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Mb800.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/Mb800.cpp	(revision 157)
@@ -33,4 +33,6 @@
   this->serialport = serialport;
   serialport->SetRxTimeout(100000000);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/Novatel.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Novatel.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/Novatel.cpp	(revision 157)
@@ -32,4 +32,6 @@
     : NmeaGps(name, NMEAFlags), Thread(getFrameworkManager(), name, priority) {
   this->serialport = serialport;
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/Ps3Eye.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Ps3Eye.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/Ps3Eye.cpp	(revision 157)
@@ -27,5 +27,7 @@
                uint8_t priority)
     : V4LCamera( name, camera_index, 320, 240,
-                cvimage::Type::Format::YUYV, priority) {}
+                cvimage::Type::Format::YUYV, priority) {
+  SetIsReady(true);                  
+}
 
 Ps3Eye::~Ps3Eye() {}
Index: trunk/lib/FlairSensorActuator/src/RadioReceiver.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/RadioReceiver.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/RadioReceiver.cpp	(revision 157)
@@ -53,4 +53,6 @@
 
   AddDataToLog(output);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 157)
@@ -42,4 +42,6 @@
   GroupBox *groupbox = new GroupBox(layout->NewRow(), "simubldc");
   k = new DoubleSpinBox(groupbox->NewRow(), "k driver:", 0, 10000, 1);
+  
+  SetIsReady(true);
 }
 
@@ -58,4 +60,6 @@
 
   shmem->Write((char *)&values, motors_count * sizeof(float));
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuCamera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 157)
@@ -45,4 +45,6 @@
   dev_name << "simu_cam_" << dev_id;
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), buf_size, SharedMem::Type::producerConsumer);
+  
+  SetIsReady(true);
 }
 
@@ -59,4 +61,6 @@
                         buf_size, SharedMem::Type::producerConsumer);
   shmemReadBuf=NULL;
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuGps.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 157)
@@ -53,4 +53,6 @@
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
                         sizeof(gps_states_t));
+                        
+  SetIsReady(true);
 }
 
@@ -64,4 +66,6 @@
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
                         sizeof(gps_states_t));
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuImu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 157)
@@ -45,4 +45,5 @@
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
                         sizeof(imu_states_t));
+  SetIsReady(true);
 }
 
@@ -55,4 +56,5 @@
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
                         sizeof(imu_states_t));
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuLaser.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 157)
@@ -41,5 +41,6 @@
   dev_name << "simu_Laser_" << dev_id;
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
-                        360 * sizeof(float)); //****
+                        360 * sizeof(float));
+  SetIsReady(true);
 }
 
@@ -52,4 +53,5 @@
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
                         360 * sizeof(float));
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuUs.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 157)
@@ -41,4 +41,6 @@
   dev_name << "simu_us_" << dev_id;
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), sizeof(float));
+
+  SetIsReady(true);
 }
 
@@ -50,4 +52,6 @@
   dev_name << "simu_us_" << dev_id;
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), sizeof(float));
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/Srf08.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Srf08.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/Srf08.cpp	(revision 157)
@@ -53,4 +53,6 @@
   SetRange();
   SetMaxGain();
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/VrpnObject.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 157)
@@ -35,4 +35,6 @@
   pimpl_ = new VrpnObject_impl(this, name, -1, tab);
   AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
 }
 
@@ -43,4 +45,6 @@
   pimpl_ = new VrpnObject_impl(this, name, id, tab);
   AddDataToLog(pimpl_->output);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSensorActuator/src/XBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/XBldc.cpp	(revision 156)
+++ trunk/lib/FlairSensorActuator/src/XBldc.cpp	(revision 157)
@@ -30,4 +30,6 @@
     : Bldc(parent, layout, name, 4) {
   pimpl_ = new XBldc_impl(this, i2cport);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSimulator/src/Man.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Man.cpp	(revision 156)
+++ trunk/lib/FlairSimulator/src/Man.cpp	(revision 157)
@@ -60,4 +60,6 @@
   r_speed = new DoubleSpinBox(setup_tab->NewRow(), "rotational speed (deg/s):",
                               0, 180, 10);
+                              
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSimulator/src/X4.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/X4.cpp	(revision 156)
+++ trunk/lib/FlairSimulator/src/X4.cpp	(revision 157)
@@ -76,4 +76,6 @@
 
   motors = new SimuBldc(this, name, 4, dev_id);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSimulator/src/X4.h
===================================================================
--- trunk/lib/FlairSimulator/src/X4.h	(revision 156)
+++ trunk/lib/FlairSimulator/src/X4.h	(revision 157)
@@ -19,6 +19,4 @@
 
 #include <Model.h>
-#include <stdint.h>
-#include <stdio.h>
 
 namespace flair {
Index: trunk/lib/FlairSimulator/src/X8.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/X8.cpp	(revision 156)
+++ trunk/lib/FlairSimulator/src/X8.cpp	(revision 157)
@@ -85,4 +85,6 @@
 
   motors = new SimuBldc(this, name, 8, dev_id);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairSimulator/src/X8.h
===================================================================
--- trunk/lib/FlairSimulator/src/X8.h	(revision 156)
+++ trunk/lib/FlairSimulator/src/X8.h	(revision 157)
@@ -19,5 +19,4 @@
 
 #include <Model.h>
-#include <stdint.h>
 
 namespace flair {
Index: trunk/lib/FlairVisionFilter/src/CvtColor.cpp
===================================================================
--- trunk/lib/FlairVisionFilter/src/CvtColor.cpp	(revision 156)
+++ trunk/lib/FlairVisionFilter/src/CvtColor.cpp	(revision 157)
@@ -37,4 +37,6 @@
         Err("conversion not supported\n");
     }
+    
+    SetIsReady(true);
 }
 
Index: trunk/lib/FlairVisionFilter/src/HoughLines.cpp
===================================================================
--- trunk/lib/FlairVisionFilter/src/HoughLines.cpp	(revision 156)
+++ trunk/lib/FlairVisionFilter/src/HoughLines.cpp	(revision 157)
@@ -56,8 +56,12 @@
         if(imageType.GetFormat()!=cvimage::Type::Format::Gray) {
             Err("input image is not gray\n");
+            return;
         }
     } catch(std::bad_cast& bc) {
         Err("io type mismatch\n");
+        return;
     }
+    
+    SetIsReady(true);
 }
 
Index: trunk/lib/FlairVisionFilter/src/ImgThreshold.cpp
===================================================================
--- trunk/lib/FlairVisionFilter/src/ImgThreshold.cpp	(revision 156)
+++ trunk/lib/FlairVisionFilter/src/ImgThreshold.cpp	(revision 157)
@@ -36,8 +36,11 @@
         } else {
             Err("input image is not gray\n");
+            return;
         }
     } catch(std::bad_cast& bc) {
         Err("io type mismatch\n");
+        return;
     }
+    SetIsReady(true);
 }
 
Index: trunk/lib/FlairVisionFilter/src/OpticalFlow.cpp
===================================================================
--- trunk/lib/FlairVisionFilter/src/OpticalFlow.cpp	(revision 156)
+++ trunk/lib/FlairVisionFilter/src/OpticalFlow.cpp	(revision 157)
@@ -48,4 +48,5 @@
         pyr=NULL;
         pyr_old=NULL;
+        return;
     }
 
@@ -63,4 +64,6 @@
     found_feature=(char *)cvAlloc(max_features->Value()*sizeof(char));
     feature_error=(unsigned int *)cvAlloc(max_features->Value()*sizeof(unsigned int));
+    
+    SetIsReady(true);
 }
 
Index: trunk/lib/FlairVisionFilter/src/OpticalFlowSpeed.cpp
===================================================================
--- trunk/lib/FlairVisionFilter/src/OpticalFlowSpeed.cpp	(revision 156)
+++ trunk/lib/FlairVisionFilter/src/OpticalFlowSpeed.cpp	(revision 157)
@@ -34,4 +34,6 @@
 
 	AddDataToLog(output);
+  
+  SetIsReady(true);
 }
 
Index: trunk/lib/FlairVisionFilter/src/Sobel.cpp
===================================================================
--- trunk/lib/FlairVisionFilter/src/Sobel.cpp	(revision 156)
+++ trunk/lib/FlairVisionFilter/src/Sobel.cpp	(revision 157)
@@ -38,9 +38,12 @@
         } else {
             Err("input image is not gray\n");
+            return;
         }
 
     } catch(std::bad_cast& bc) {
         Err("io type mismatch\n");
+        return;
     }
+    SetIsReady(true);
 }
 
