Ejemplo n.º 1
0
void fsExperiments::setup()
{
	gl::disableVerticalSync();

	GlobalData::get().mFaceShift.import( "export" );

	mEyeDistance = -300;

	mEffects.push_back( fsExpRef( new Android() ) );
	mEffects.push_back( fsExpRef( new Devil() ) );
	mEffects.push_back( fsExpRef( new Twister() ) );

	setupParams();
	setupVbo();
	setupEyes();
	setupEffects();

	Surface headImg = loadImage( loadAsset( "loki2.png" ) );
	ip::flipVertical( &headImg );
	GlobalData::get().mHeadTexture = gl::Texture( headImg );

	//GlobalData::get().mFaceShift.connect();

	gl::enable( GL_CULL_FACE );
}
Ejemplo n.º 2
0
/*---------------------------------------------------------------------------*/
void initialize_userland(void)
{
	FIL paramFile;
	
	//J パラメータファイルからパラメータを読み込む
	char fileName[16] = "uparam.txt";
	int8_t ret = f_open(&paramFile, fileName, FA_READ);	
	if (ret == FR_OK) {
		char line[100];
		while (f_gets(line, 100, &paramFile) != NULL) {
			setupParams(line, sCheckAndStoreParam);
		}

		f_close(&paramFile);
	} else {
	}
	
	//J ユーザログファイルを開く
	char logFileName[16] = "ulog.txt";
	ret = f_open(&sLogFile, logFileName,  FA_WRITE | FA_OPEN_ALWAYS);
	//J 基本追記でやります
	if (ret == FR_OK) {
		UINT len = 0;
		f_lseek(&sLogFile, f_size(&sLogFile));
		f_write(&sLogFile, "-- Start Userland\n", 18, &len);
		f_sync(&sLogFile);
	} else {
	}

	return;	
}
Ejemplo n.º 3
0
/********************************************************************************************
** INDI is asking us to update the properties because there is a change in CONNECTION status
** This fucntion is called whenever the device is connected or disconnected.
*********************************************************************************************/
bool INovaCCD::updateProperties()
{
    // Call parent update properties
    INDI::CCD::updateProperties();

    if (isConnected())
    {
        // Define our properties
        IUSaveText(&iNovaInformationT[0], iNovaSDK_GetName());
        IUSaveText(&iNovaInformationT[1], iNovaSDK_SensorName());
        IUSaveText(&iNovaInformationT[2], iNovaSDK_SerialNumber());
        IUSaveText(&iNovaInformationT[3], (iNovaSDK_HasST4() ? "Yes" : "No"));
        IUSaveText(&iNovaInformationT[4], (iNovaSDK_HasColorSensor() ? "Yes" : "No"));
        defineText(&iNovaInformationTP);
        defineNumber(&CameraPropertiesNP);

        // Let's get parameters now from CCD
        setupParams();

        // Start the timer
        SetTimer(POLLMS);
    }
    else
        // We're disconnected
    {
        deleteProperty(iNovaInformationTP.name);
        deleteProperty(CameraPropertiesNP.name);
    }

    return true;
}
Ejemplo n.º 4
0
/*******************************************************************************
** INDI is asking us to update the properties because there is a change in
** CONNECTION status. This fucntion is called whenever the device is
** connected or disconnected.
*******************************************************************************/
bool DSICCD::updateProperties()
{
    // Call parent update properties first
    INDI::CCD::updateProperties();

    if (isConnected())
    {

        // Let's get parameters now from CCD
        setupParams();

        // Start the timer
        SetTimer(POLLMS);
        defineNumber(&GainNP);
        defineNumber(&OffsetNP);
        defineNumber(&CCDTempNP);
	defineSwitch(&VddExpSP);
    }
    else
    {
        deleteProperty(GainNP.name);
        deleteProperty(OffsetNP.name);
        deleteProperty(CCDTempNP.name);
        deleteProperty(VddExpSP.name);
    }

    return true;
}
Ejemplo n.º 5
0
//==============================================================================
DRowAudioFilter::DRowAudioFilter()
	:	RMSLeft(0),
		RMSRight(0),
		peakLeft(0),
		peakRight(0)

{
	setupParams();
}
Ejemplo n.º 6
0
bool ASICCD::updateProperties()
{
  INDI::CCD::updateProperties();

  if (isConnected())
  {
    if (HasCooler())
    {
        defineNumber(&CoolerNP);
        defineSwitch(&CoolerSP);
    }
    // Even if there is no cooler, we define temperature property as READ ONLY
    else
    {
        TemperatureNP.p = IP_RO;
        defineNumber(&TemperatureNP);
    }

    // Let's get parameters now from CCD
    setupParams();

    if (ControlNP.nnp > 0)
     defineNumber(&ControlNP);

    if (ControlSP.nsp > 0)
        defineSwitch(&ControlSP);

    if (VideoFormatSP.nsp > 0)
        defineSwitch(&VideoFormatSP);

    SetTimer(POLLMS);
  } else
  {

    if (HasCooler())
    {
        deleteProperty(CoolerNP.name);
        deleteProperty(CoolerSP.name);
    }
    else
        deleteProperty(TemperatureNP.name);

    if (ControlNP.nnp > 0)
        deleteProperty(ControlNP.name);

    if (ControlSP.nsp > 0)
        deleteProperty(ControlSP.name);

    if (VideoFormatSP.nsp > 0)
        deleteProperty(VideoFormatSP.name);
  }

  return true;
}
Ejemplo n.º 7
0
//==============================================================================
DRowAudioFilter::DRowAudioFilter()
	:	RMSLeft(0),
		RMSRight(0),
		peakLeft(0),
		peakRight(0)

{
	setupParams();
	
	waveformDisplayPre = new AudioOscilliscope;
	waveformDisplayPost = new AudioOscilliscope;
}
Ejemplo n.º 8
0
bool ATIKCCD::Connect()
{
    LOGF_DEBUG("Attempting to open %s...", name);

    hCam = ArtemisConnect(m_iDevice);

    if (hCam == nullptr)
    {
        LOGF_ERROR("Failed to connected to %s", name);
        return false;
    }

    return setupParams();
}
Ejemplo n.º 9
0
bool QSICCD::updateProperties()
{

    INDI::CCD::updateProperties();

    if (isConnected())
    {
        defineSwitch(&CoolerSP);
        defineSwitch(&ShutterSP);
        defineNumber(&CoolerNP);
        defineNumber(&FilterSlotNP);
        defineSwitch(&FilterSP);

        setupParams();

        if (FilterNameT != NULL)
            defineText(FilterNameTP);

        manageDefaults();

        timerID = SetTimer(POLLMS);
    }
    else
    {
        deleteProperty(CoolerSP.name);
        deleteProperty(ShutterSP.name);
        deleteProperty(CoolerNP.name);
        deleteProperty(FilterSlotNP.name);
        deleteProperty(FilterSP.name);

        if (canSetGain)
            deleteProperty(GainSP.name);

        if (canSetAB)
            deleteProperty(ABSP.name);

        if (canControlFan)
            deleteProperty(FanSP.name);

        if (canChangeReadoutSpeed)
            deleteProperty(ReadOutSP.name);

        if (FilterNameT != NULL)
            deleteProperty(FilterNameTP->name);

        rmTimer(timerID);
    }

    return true;
}
Ejemplo n.º 10
0
bool JoyStick::Connect()
{
    bool rc = driver->Connect();

    if (rc)
    {
        DEBUG(INDI::Logger::DBG_SESSION, "Joystick is online.");

        setupParams();
    }
    else
        DEBUG(INDI::Logger::DBG_SESSION, "Error: cannot find Joystick device.");

    return rc;
}
Ejemplo n.º 11
0
/********************************************************************************************
** INDI is asking us to update the properties because there is a change in CONNECTION status
** This fucntion is called whenever the device is connected or disconnected.
*********************************************************************************************/
bool SimpleDetector::updateProperties()
{
    // Call parent update properties first
    INDI::Detector::updateProperties();

    if (isConnected())
    {
        // Let's get parameters now from Detector
        setupParams();

        // Start the timer
        SetTimer(POLLMS);
    }

    return true;
}
Ejemplo n.º 12
0
bool JoyStick::Connect()
{
    bool rc = driver->Connect();

    if (rc)
    {
        IDMessage(getDeviceName(), "Joystick is online.");

        setupParams();

    }
    else
        IDMessage(getDeviceName(), "Error: cannot find Joystick device.");

    return rc;
    
}
Ejemplo n.º 13
0
/********************************************************************************************
** INDI is asking us to update the properties because there is a change in CONNECTION status
** This fucntion is called whenever the device is connected or disconnected.
*********************************************************************************************/
bool RadioSim::updateProperties()
{
    // Call parent update properties first
    INDI::Detector::updateProperties();

    if (isConnected())
    {
        // Let's get parameters now from Detector
        setupParams();
        defineNumber(&DetectorPropertiesNP);
        defineNumber(&DetectorCoordsNP);

        // Start the timer
        SetTimer(POLLMS);
    }

    return true;
}
Ejemplo n.º 14
0
/********************************************************************************************
** INDI is asking us to update the properties because there is a change in CONNECTION status
** This fucntion is called whenever the device is connected or disconnected.
*********************************************************************************************/
bool FFMVCCD::updateProperties()
{
    // Call parent update properties first
    INDI::CCD::updateProperties();

    if (isConnected())
    {

        // Let's get parameters now from CCD
        setupParams();

        // Start the timer
        SetTimer(POLLMS);
        defineSwitch(&GainSP);
    } else {
        deleteProperty(GainSP.name);
    }

    return true;
}
Ejemplo n.º 15
0
bool SynscanDriver::updateProperties()
{
    INDI::Telescope::updateProperties();

    if (isConnected())
    {
        setupParams();

        defineNumber(&HorizontalCoordsNP);
        defineText(&StatusTP);
        defineNumber(&CustomSlewRateNP);
        defineNumber(&GuideNSNP);
        defineNumber(&GuideWENP);
        defineNumber(&GuideRateNP);

        if (InitPark())
        {
            SetAxis1ParkDefault(359);
            SetAxis2ParkDefault(m_isAltAz ? 0 : LocationN[LOCATION_LATITUDE].value);
        }
        else
        {
            SetAxis1Park(359);
            SetAxis2Park(m_isAltAz ? 0 : LocationN[LOCATION_LATITUDE].value);
            SetAxis1ParkDefault(359);
            SetAxis2ParkDefault(m_isAltAz ? 0 : LocationN[LOCATION_LATITUDE].value);
        }
    }
    else
    {
        deleteProperty(HorizontalCoordsNP.name);
        deleteProperty(StatusTP.name);
        deleteProperty(CustomSlewRateNP.name);
        deleteProperty(GuideNSNP.name);
        deleteProperty(GuideWENP.name);
        deleteProperty(GuideRateNP.name);
    }

    return true;
}
void Wormhole3ContinuousOutputs::setup()
{
	setupParams();

	mReceived = vec3(1);
	mCamera.setPerspective(60.0f, getWindowAspectRatio(), 0.1f, 10.f);
	mCamera.lookAt(vec3(0, kEyeDepth, 0), vec3(), vec3(0, 1, 0));

	mShader = gl::GlslProg::create(loadAsset("shaders/wormhole.vert"), loadAsset("shaders/wormhole.frag"));

	auto mesh = gl::VboMesh::create(geom::Torus().center(vec3()).radius(0.5f, 0.49f).subdivisionsAxis(64).subdivisionsHeight(4));
	geom::BufferLayout attribs;
	attribs.append(geom::CUSTOM_0, 4, sizeof(Ring), offsetof(Ring, Tint), 1);
	attribs.append(geom::CUSTOM_1, 3, sizeof(Ring), offsetof(Ring, Position), 1);
	attribs.append(geom::CUSTOM_2, 2, sizeof(Ring), offsetof(Ring, Size), 1);

	mRings.push_back(Ring(Color(1, 0, 0), vec2(mReceived.x, mReceived.y)));
	mData = gl::Vbo::create(GL_ARRAY_BUFFER, mRings, GL_DYNAMIC_DRAW);
	mesh->appendVbo(attribs, mData);

	mDraw = gl::Batch::create(mesh, mShader, { {geom::CUSTOM_0, "i_Tint"},{ geom::CUSTOM_1, "i_Position" },{ geom::CUSTOM_2, "i_Size" } });

	setupListener();
}
Ejemplo n.º 17
0
//==============================================================================
DRowAudioFilter::DRowAudioFilter()
{
    setupParams();
}
Ejemplo n.º 18
0
bool MICCD::updateProperties()
{
    INDI::CCD::updateProperties();

    if (isConnected())
    {
        if (HasCooler())
        {
            defineNumber(&TemperatureRampNP);
            defineNumber(&CoolerNP);
            temperatureID = IEAddTimer(POLLMS, MICCD::updateTemperatureHelper, this);
        }

        defineSwitch(&ReadModeSP);

        if (maxFanValue > 0)
            defineNumber(&FanNP);

        if (maxHeatingValue > 0)
            defineNumber(&WindowHeatingNP);

        if (hasGain)
            defineNumber(&GainNP);

        if (canDoPreflash)
            defineNumber(&PreflashNP);

        if (numFilters > 0)
        {
            INDI::FilterInterface::updateProperties();
        }

        // Let's get parameters now from CCD
        setupParams();

        timerID = SetTimer(POLLMS);
    }
    else
    {
        if (HasCooler())
        {
            deleteProperty(TemperatureRampNP.name);
            deleteProperty(CoolerNP.name);
            RemoveTimer(temperatureID);
        }

        deleteProperty(ReadModeSP.name);

        if (maxFanValue > 0)
            deleteProperty(FanNP.name);

        if (maxHeatingValue > 0)
            deleteProperty(WindowHeatingNP.name);

        if (hasGain)
            deleteProperty(GainNP.name);

        if (canDoPreflash)
            deleteProperty(PreflashNP.name);

        if (numFilters > 0)
        {
            INDI::FilterInterface::updateProperties();
        }
        RemoveTimer(timerID);
    }

    return true;
}
Ejemplo n.º 19
0
bool MICCD::updateProperties()
{
    INDI::CCD::updateProperties();

    if (isConnected())
    {
        if (HasCooler())
        {
            defineNumber(&TemperatureRampNP);
            defineNumber(&CoolerNP);
            temperatureID = IEAddTimer(POLLMS, MICCD::updateTemperatureHelper, this);
        }

        defineSwitch(&NoiseSP);

        if (maxFanValue > 0)
            defineNumber(&FanNP);

        if (maxHeatingValue > 0)
            defineNumber(&WindowHeatingNP);

        if (hasGain)
            defineNumber(&GainNP);

        if (numFilters > 0)
        {
            //Define the Filter Slot and name properties
            defineNumber(&FilterSlotNP);
            GetFilterNames(FILTER_TAB);
            defineText(FilterNameTP);
        }

        // Let's get parameters now from CCD
        setupParams();

        timerID = SetTimer(POLLMS);
    }
    else
    {
        if (HasCooler())
        {
            deleteProperty(TemperatureRampNP.name);
            deleteProperty(CoolerNP.name);
            RemoveTimer(temperatureID);
        }

        deleteProperty(NoiseSP.name);

        if (maxFanValue > 0)
            deleteProperty(FanNP.name);

        if (maxHeatingValue > 0)
            deleteProperty(WindowHeatingNP.name);

        if (hasGain)
            deleteProperty(GainNP.name);

        if (numFilters > 0)
        {
            deleteProperty(FilterSlotNP.name);
            deleteProperty(FilterNameTP->name);
        }
        RemoveTimer(timerID);
    }

    return true;
}
Ejemplo n.º 20
0
bool QHYCCD::updateProperties()
{
  INDI::CCD::updateProperties();
  double min,max,step;

  if (isConnected())
  {

      if (HasCooler())
      {
          defineSwitch(&CoolerSP);
          defineNumber(&CoolerNP);

          temperatureID = IEAddTimer(POLLMS, QHYCCD::updateTemperatureHelper, this);
      }

      if(HasUSBSpeed)
      {
          if (sim)
          {
              SpeedN[0].min = 1;
              SpeedN[0].max = 5;
              SpeedN[0].step = 1;
              SpeedN[0].value = 1;
          }
          else
          {
              int ret = GetQHYCCDParamMinMaxStep(camhandle,CONTROL_SPEED,&min,&max,&step);
              if(ret == QHYCCD_SUCCESS)
              {
                  SpeedN[0].min = min;
                  SpeedN[0].max = max;
                  SpeedN[0].step = step;
              }

              SpeedN[0].value = GetQHYCCDParam(camhandle,CONTROL_SPEED);

              DEBUGF(INDI::Logger::DBG_DEBUG, "USB Speed. Value: %g Min: %g Max: %g Step %g", SpeedN[0].value, SpeedN[0].min, SpeedN[0].max, SpeedN[0].step);
          }

          defineNumber(&SpeedNP);
      }

      if(HasGain)
      {
          if (sim)
          {
              GainN[0].min = 0;
              GainN[0].max = 100;
              GainN[0].step = 10;
              GainN[0].value = 50;
          }
          else
          {
              int ret = GetQHYCCDParamMinMaxStep(camhandle,CONTROL_GAIN,&min,&max,&step);
              if(ret == QHYCCD_SUCCESS)
              {
                  GainN[0].min = min;
                  GainN[0].max = max;
                  GainN[0].step = step;
              }
              GainN[0].value = GetQHYCCDParam(camhandle,CONTROL_GAIN);

              DEBUGF(INDI::Logger::DBG_DEBUG, "Gain. Value: %g Min: %g Max: %g Step %g", GainN[0].value, GainN[0].min, GainN[0].max, GainN[0].step);
          }

          defineNumber(&GainNP);
      }

      if(HasOffset)
      {
          if (sim)
          {
              OffsetN[0].min = 1;
              OffsetN[0].max = 10;
              OffsetN[0].step = 1;
              OffsetN[0].value = 1;
          }
          else
          {
              int ret = GetQHYCCDParamMinMaxStep(camhandle,CONTROL_OFFSET,&min,&max,&step);
              if(ret == QHYCCD_SUCCESS)
              {
                  OffsetN[0].min = min;
                  OffsetN[0].max = max;
                  OffsetN[0].step = step;
              }
              OffsetN[0].value = GetQHYCCDParam(camhandle,CONTROL_OFFSET);

              DEBUGF(INDI::Logger::DBG_DEBUG, "Offset. Value: %g Min: %g Max: %g Step %g", OffsetN[0].value, OffsetN[0].min, OffsetN[0].max, OffsetN[0].step);
          }

          //Define the Offset
          defineNumber(&OffsetNP);
      }

      if(HasFilters)
      {
          //Define the Filter Slot and name properties
          defineNumber(&FilterSlotNP);

          GetFilterNames(FILTER_TAB);
          defineText(FilterNameTP);
      }

      if (HasUSBTraffic)
      {
          if (sim)
          {
              USBTrafficN[0].min = 1;
              USBTrafficN[0].max = 100;
              USBTrafficN[0].step = 5;
              USBTrafficN[0].value = 20;
          }
          else
          {
              int ret = GetQHYCCDParamMinMaxStep(camhandle,CONTROL_USBTRAFFIC,&min,&max,&step);
              if(ret == QHYCCD_SUCCESS)
              {
                  USBTrafficN[0].min = min;
                  USBTrafficN[0].max = max;
                  USBTrafficN[0].step = step;
              }
              USBTrafficN[0].value = GetQHYCCDParam(camhandle,CONTROL_USBTRAFFIC);

              DEBUGF(INDI::Logger::DBG_DEBUG, "USB Traffic. Value: %g Min: %g Max: %g Step %g", USBTrafficN[0].value, USBTrafficN[0].min, USBTrafficN[0].max, USBTrafficN[0].step);
          }
        defineNumber(&USBTrafficNP);
      }

    // Let's get parameters now from CCD
    setupParams();

    //timerID = SetTimer(POLLMS);
  } else
  {

      if (HasCooler())
      {
          deleteProperty(CoolerSP.name);
          deleteProperty(CoolerNP.name);
      }

      if(HasUSBSpeed)
      {
          deleteProperty(SpeedNP.name);
      }

      if(HasGain)
      {
          deleteProperty(GainNP.name);
      }

      if(HasOffset)
      {
          deleteProperty(OffsetNP.name);
      }

      if(HasFilters)
      {
          deleteProperty(FilterSlotNP.name);
          deleteProperty(FilterNameTP->name);
      }

      if (HasUSBTraffic)
        deleteProperty(USBTrafficNP.name);

    RemoveTimer(timerID);
  }

  return true;
}
Ejemplo n.º 21
0
bool QHYCCD::updateProperties()
{
    double min=0, max=0, step=0;

    // This must be executed BEFORE INDI::CCD::updateProperties()
    // Since Primary CCD Exposure will be defined in there so we have to get its limits now
    {
        // Exposure limits in microseconds
        int ret = GetQHYCCDParamMinMaxStep(camhandle, CONTROL_EXPOSURE, &min, &max, &step);
        if (ret == QHYCCD_SUCCESS)
            PrimaryCCD.setMinMaxStep("CCD_EXPOSURE", "CCD_EXPOSURE_VALUE", min/1e6, max/1e6, step/1e6, false);
        else
            PrimaryCCD.setMinMaxStep("CCD_EXPOSURE", "CCD_EXPOSURE_VALUE", 0.001, 3600, 1, false);

            DEBUGF(INDI::Logger::DBG_DEBUG, "Exposure. Min: %g Max: %g Step %g", min, max, step);
    }

    // Define parent class properties
    INDI::CCD::updateProperties();

    if (isConnected())
    {
        if (HasCooler())
        {
            defineSwitch(&CoolerSP);
            defineNumber(&CoolerNP);

            temperatureID = IEAddTimer(POLLMS, QHYCCD::updateTemperatureHelper, this);
        }

        if (HasUSBSpeed)
        {
            if (sim)
            {
                SpeedN[0].min   = 1;
                SpeedN[0].max   = 5;
                SpeedN[0].step  = 1;
                SpeedN[0].value = 1;
            }
            else
            {
                int ret = GetQHYCCDParamMinMaxStep(camhandle, CONTROL_SPEED, &min, &max, &step);
                if (ret == QHYCCD_SUCCESS)
                {
                    SpeedN[0].min  = min;
                    SpeedN[0].max  = max;
                    SpeedN[0].step = step;
                }

                SpeedN[0].value = GetQHYCCDParam(camhandle, CONTROL_SPEED);

                DEBUGF(INDI::Logger::DBG_DEBUG, "USB Speed. Value: %g Min: %g Max: %g Step %g", SpeedN[0].value,
                       SpeedN[0].min, SpeedN[0].max, SpeedN[0].step);
            }

            defineNumber(&SpeedNP);
        }

        if (HasGain)
        {
            if (sim)
            {
                GainN[0].min   = 0;
                GainN[0].max   = 100;
                GainN[0].step  = 10;
                GainN[0].value = 50;
            }
            else
            {
                int ret = GetQHYCCDParamMinMaxStep(camhandle, CONTROL_GAIN, &min, &max, &step);
                if (ret == QHYCCD_SUCCESS)
                {
                    GainN[0].min  = min;
                    GainN[0].max  = max;
                    GainN[0].step = step;
                }
                GainN[0].value = GetQHYCCDParam(camhandle, CONTROL_GAIN);

                DEBUGF(INDI::Logger::DBG_DEBUG, "Gain. Value: %g Min: %g Max: %g Step %g", GainN[0].value, GainN[0].min,
                       GainN[0].max, GainN[0].step);
            }

            defineNumber(&GainNP);
        }

        if (HasOffset)
        {
            if (sim)
            {
                OffsetN[0].min   = 1;
                OffsetN[0].max   = 10;
                OffsetN[0].step  = 1;
                OffsetN[0].value = 1;
            }
            else
            {
                int ret = GetQHYCCDParamMinMaxStep(camhandle, CONTROL_OFFSET, &min, &max, &step);
                if (ret == QHYCCD_SUCCESS)
                {
                    OffsetN[0].min  = min;
                    OffsetN[0].max  = max;
                    OffsetN[0].step = step;
                }
                OffsetN[0].value = GetQHYCCDParam(camhandle, CONTROL_OFFSET);

                DEBUGF(INDI::Logger::DBG_DEBUG, "Offset. Value: %g Min: %g Max: %g Step %g", OffsetN[0].value,
                       OffsetN[0].min, OffsetN[0].max, OffsetN[0].step);
            }

            //Define the Offset
            defineNumber(&OffsetNP);
        }

        if (HasFilters)
        {
            INDI::FilterInterface::updateProperties();
        }

        if (HasUSBTraffic)
        {
            if (sim)
            {
                USBTrafficN[0].min   = 1;
                USBTrafficN[0].max   = 100;
                USBTrafficN[0].step  = 5;
                USBTrafficN[0].value = 20;
            }
            else
            {
                int ret = GetQHYCCDParamMinMaxStep(camhandle, CONTROL_USBTRAFFIC, &min, &max, &step);
                if (ret == QHYCCD_SUCCESS)
                {
                    USBTrafficN[0].min  = min;
                    USBTrafficN[0].max  = max;
                    USBTrafficN[0].step = step;
                }
                USBTrafficN[0].value = GetQHYCCDParam(camhandle, CONTROL_USBTRAFFIC);

                DEBUGF(INDI::Logger::DBG_DEBUG, "USB Traffic. Value: %g Min: %g Max: %g Step %g", USBTrafficN[0].value,
                       USBTrafficN[0].min, USBTrafficN[0].max, USBTrafficN[0].step);
            }
            defineNumber(&USBTrafficNP);
        }

        // Let's get parameters now from CCD
        setupParams();

        //timerID = SetTimer(POLLMS);
    }
    else
    {
        if (HasCooler())
        {
            deleteProperty(CoolerSP.name);
            deleteProperty(CoolerNP.name);
        }

        if (HasUSBSpeed)
        {
            deleteProperty(SpeedNP.name);
        }

        if (HasGain)
        {
            deleteProperty(GainNP.name);
        }

        if (HasOffset)
        {
            deleteProperty(OffsetNP.name);
        }

        if (HasFilters)
        {
            INDI::FilterInterface::updateProperties();
        }

        if (HasUSBTraffic)
            deleteProperty(USBTrafficNP.name);

        RemoveTimer(timerID);
    }

    return true;
}