bool SDIOAnalyzerSettings::SetSettingsFromInterfaces()
{
	// mInputChannel = mInputChannelInterface->GetChannel();
	// mBitRate = mBitRateInterface->GetInteger();

	// check channel selection
	{
		Channel d0, d1, d2, d3;
		d0 = mDAT0ChannelInterface->GetChannel();
		d1 = mDAT1ChannelInterface->GetChannel();
		d2 = mDAT2ChannelInterface->GetChannel();
		d3 = mDAT3ChannelInterface->GetChannel();

		if (d1 == UNDEFINED_CHANNEL && d2 == UNDEFINED_CHANNEL && d3 == UNDEFINED_CHANNEL)
		{
			// this is valid, continue
		}
		else if (d1 != UNDEFINED_CHANNEL && d2 != UNDEFINED_CHANNEL && d3 != UNDEFINED_CHANNEL)
		{
			// this is also valid, continue
		}
		else
		{
			// invalid combination
			SetErrorText("Invalid data line selection. If D0 is set, either all or none of the other data lines must be set.");
			return false;
		}

		std::vector<Channel> channels;
		channels.push_back(d0);
		channels.push_back(d1);
		channels.push_back(d2);
		channels.push_back(d3);
		channels.push_back(mClockChannelInterface->GetChannel());
		channels.push_back(mCmdChannelInterface->GetChannel());

		if (AnalyzerHelpers::DoChannelsOverlap(channels.data(), channels.size()) == true)
		{
			SetErrorText("Channel selections must be unique");
			return false;
		}
	}

	mClockChannel = mClockChannelInterface->GetChannel();
	mCmdChannel = mCmdChannelInterface->GetChannel();
	mDAT0Channel = mDAT0ChannelInterface->GetChannel();
	mDAT1Channel = mDAT1ChannelInterface->GetChannel();
	mDAT2Channel = mDAT2ChannelInterface->GetChannel();
	mDAT3Channel = mDAT3ChannelInterface->GetChannel();

	ClearChannels();
	// AddChannel( mInputChannel, "SDIO", true );

	AddChannel( mClockChannel, "Clock", true );
	AddChannel( mCmdChannel, "Command", true );
	AddChannel( mDAT0Channel, "DAT0", true );
	AddChannel( mDAT1Channel, "DAT1", mDAT1Channel != UNDEFINED_CHANNEL);
	AddChannel( mDAT2Channel, "DAT2", mDAT2Channel != UNDEFINED_CHANNEL);
	AddChannel( mDAT3Channel, "DAT3", mDAT3Channel != UNDEFINED_CHANNEL);
	return true;
}
Esempio n. 2
0
PIZStage::PIZStage()
    : axisName_("1")
    , stepSizeUm_(0.1)
    , initialized_(false)
    , axisLimitUm_(500.0)
    , invertTravelRange_(false)
    , stageType_("DEFAULT_STAGE")
    , controllerName_("")
    , ctrl_(NULL)
{
   InitializeDefaultErrorMessages();

   SetErrorText(ERR_GCS_PI_CNTR_POS_OUT_OF_LIMITS, g_msg_CNTR_POS_OUT_OF_LIMITS);
   SetErrorText(ERR_GCS_PI_CNTR_MOVE_WITHOUT_REF_OR_NO_SERVO, g_msg_CNTR_MOVE_WITHOUT_REF_OR_NO_SERVO);
   SetErrorText(ERR_GCS_PI_CNTR_AXIS_UNDER_JOYSTICK_CONTROL, g_msg_CNTR_AXIS_UNDER_JOYSTICK_CONTROL);
   SetErrorText(ERR_GCS_PI_CNTR_INVALID_AXIS_IDENTIFIER, g_msg_CNTR_INVALID_AXIS_IDENTIFIER);
   SetErrorText(ERR_GCS_PI_CNTR_ILLEGAL_AXIS, g_msg_CNTR_ILLEGAL_AXIS);
   SetErrorText(ERR_GCS_PI_CNTR_VEL_OUT_OF_LIMITS, g_msg_CNTR_VEL_OUT_OF_LIMITS);
   SetErrorText(ERR_GCS_PI_CNTR_ON_LIMIT_SWITCH, g_msg_CNTR_ON_LIMIT_SWITCH);
   SetErrorText(ERR_GCS_PI_CNTR_MOTION_ERROR, g_msg_CNTR_MOTION_ERROR);
   SetErrorText(ERR_GCS_PI_MOTION_ERROR, g_msg_MOTION_ERROR);
   SetErrorText(ERR_GCS_PI_CNTR_PARAM_OUT_OF_RANGE, g_msg_CNTR_PARAM_OUT_OF_RANGE);
   SetErrorText(ERR_GCS_PI_NO_CONTROLLER_FOUND, g_msg_NO_CONTROLLER_FOUND);

   // create pre-initialization properties
   // ------------------------------------

   // Name
   CreateProperty(MM::g_Keyword_Name, DeviceName_, MM::String, true);

   // Description
   CreateProperty(MM::g_Keyword_Description, "Physik Instrumente (PI) GCS DLL Adapter", MM::String, true);

   CPropertyAction* pAct;


   // Controller name
   pAct = new CPropertyAction (this, &PIZStage::OnControllerName);
   CreateProperty(g_PI_ZStageControllerName, controllerName_.c_str(), MM::String, false, pAct, true);

   // Axis name
   pAct = new CPropertyAction (this, &PIZStage::OnAxisName);
   CreateProperty(g_PI_ZStageAxisName, axisName_.c_str(), MM::String, false, pAct, true);
   
   // Axis stage type
   pAct = new CPropertyAction (this, &PIZStage::OnStageType);
   CreateProperty(g_PI_ZStageStageType, stageType_.c_str(), MM::String, false, pAct, true);
   
   //// Axis homing mode
   //pAct = new CPropertyAction (this, &PIZStage::OnHoming);
   //CreateProperty(g_PI_ZStageHoming, homingMode_.c_str(), MM::String, false, pAct, true);
   
   // axis limit in um
   pAct = new CPropertyAction (this, &PIZStage::OnAxisLimit);
   CreateProperty(g_PI_ZStageAxisLimitUm, "500.0", MM::Float, false, pAct, true);

   // axis limit in um
   pAct = new CPropertyAction (this, &PIZStage::OnAxisTravelRange);
   CreateProperty(g_PI_ZStageInvertTravelRange, "0", MM::Integer, false, pAct, true);

   // axis limits (assumed symmetrical)
   pAct = new CPropertyAction (this, &PIZStage::OnPosition);
   CreateProperty(MM::g_Keyword_Position, "0.0", MM::Float, false, pAct);
   SetPropertyLimits(MM::g_Keyword_Position, 0.0/*-axisLimitUm_*/, axisLimitUm_);

}