PS2KeyboardAnalyzerSettings::PS2KeyboardAnalyzerSettings()
:	mClockChannel( UNDEFINED_CHANNEL ),
	mDataChannel( UNDEFINED_CHANNEL ),
	mDeviceType( 0 )
{
	mClockChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mClockChannelInterface->SetTitleAndTooltip( "Clock", "PS/2 - Clock" );
	mClockChannelInterface->SetChannel( mClockChannel );

	mDataChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mDataChannelInterface->SetTitleAndTooltip( "Data", "PS/2 - Data" );
	mDataChannelInterface->SetChannel( mDataChannel );

	mDeviceTypeInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mDeviceTypeInterface->SetTitleAndTooltip( "Device Type", "Device Type");
	mDeviceTypeInterface->AddNumber(0, "Keyboard", "Keyboard");
	mDeviceTypeInterface->AddNumber(1, "Mouse (Standard PS/2)", "Mouse (Standard PS/2)");
	mDeviceTypeInterface->AddNumber(2, "Mouse (IntelliMouse)", "Mouse (IntelliMouse)");
	mDeviceTypeInterface->SetNumber( mDeviceType );

	AddInterface( mClockChannelInterface.get() );
	AddInterface( mDataChannelInterface.get() );
	AddInterface( mDeviceTypeInterface.get() );

	AddExportOption( 0, "Export captured keys as text file (Keyboard Only)" );
	AddExportExtension( 0, "text", "txt" );
	AddExportOption( 1, "Export data as .csv log file" );
	AddExportExtension( 1, "csv", "csv" );

	ClearChannels();
	AddChannel( mClockChannel, "PS/2 - Clock", false );
	AddChannel( mDataChannel, "PS/2 - Data", false );
}
示例#2
0
IRAnalyzerSettings::IRAnalyzerSettings()
:	mInputChannel( UNDEFINED_CHANNEL ),
	mFrequency( 17777 ),
	mSignal (NEC_SIG)
{
	mInputChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mInputChannelInterface->SetTitleAndTooltip( "Input", "Standard InfraRed" );
	mInputChannelInterface->SetChannel( mInputChannel );

	mFrenquencyInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mFrenquencyInterface->SetTitleAndTooltip( "Frequency (Hz)",  "Specify the frequency used." );
	mFrenquencyInterface->SetMax( 6000000 );
	mFrenquencyInterface->SetMin( 1 );
	mFrenquencyInterface->SetInteger( mFrequency );

	mSignalInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mSignalInterface->SetTitleAndTooltip( "Signal", "Type of signal" );
    mSignalInterface->AddNumber( NEC_SIG, "NEC (32 bits)", "");
    mSignalInterface->SetNumber( mSignal );

	AddInterface( mInputChannelInterface.get() );
	AddInterface( mFrenquencyInterface.get() );
	AddInterface( mSignalInterface.get() );

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mInputChannel, "Infrared", false );
}
ISO14443AnalyzerSettings::ISO14443AnalyzerSettings()
:	mInputChannel( UNDEFINED_CHANNEL ),
	mBitRate( 9600 )
{
	mInputChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mInputChannelInterface->SetTitleAndTooltip( "DEMOD Channel", "On which Channel is the DEMOD connected?" );
	mInputChannelInterface->SetChannel( mInputChannel );

	mBitRateInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mBitRateInterface->SetTitleAndTooltip( "Bit Rate (Bits/S)",  "Specify the bit rate in bits per second." );
	mBitRateInterface->SetMax( 6000000 );
	mBitRateInterface->SetMin( 1 );
	mBitRateInterface->SetInteger( mBitRate );


	AddInterface( mInputChannelInterface.get() );
	//AddInterface( mBitRateInterface.get() );
	 
	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mInputChannel, "Serial", false );
}
PWMAnalyzerSettings::PWMAnalyzerSettings()
    :   mInputChannel(UNDEFINED_CHANNEL),
        mMinChange(3),
        mAnalysisType(ANALYSIS_WIDTH)
{
    mInputChannelInterface.reset(new AnalyzerSettingInterfaceChannel());
    mInputChannelInterface->SetTitleAndTooltip("PWM", "Simple Standard PWM Analyzer");
    mInputChannelInterface->SetChannel(mInputChannel);

    mAnalysisTypeInterface.reset(new AnalyzerSettingInterfaceNumberList());
    mAnalysisTypeInterface->SetTitleAndTooltip("Analysis Type",
            "What is important in analyzing this pwm stream?");
    mAnalysisTypeInterface->AddNumber(ANALYSIS_WIDTH, "Pulse Width", "The width of high pulses");
    mAnalysisTypeInterface->AddNumber(ANALYSIS_DUTY, "Duty Cycle", "The duty cycle between high and low");
    mAnalysisTypeInterface->SetNumber(mAnalysisType);

    mMinChangeInterface.reset(new AnalyzerSettingInterfaceInteger());
    mMinChangeInterface->SetTitleAndTooltip("Min Change(μS or %)",
                                            "The minimum amount of value change before recording a frame.");
    mMinChangeInterface->SetMax(10000);
    mMinChangeInterface->SetMin(0);
    mMinChangeInterface->SetInteger(mMinChange);

    AddInterface(mInputChannelInterface.get());
    AddInterface(mMinChangeInterface.get());
    AddInterface(mAnalysisTypeInterface.get());

    AddExportOption(0, "Export as csv file");
    AddExportExtension(0, "csv", "csv");

    ClearChannels();
    AddChannel(mInputChannel, "PWM", false);
}
AtmelSWIAnalyzerSettings::AtmelSWIAnalyzerSettings()
:	mSDAChannel(UNDEFINED_CHANNEL)
{
	// init the interface
	mSDAChannelInterface.SetTitleAndTooltip(CHANNEL_NAME, "Single Wire Interface SDA");
	mSDAChannelInterface.SetChannel(mSDAChannel);

	mDecodeLevelInterface.SetTitleAndTooltip("Decode level", "Level of the communication to decode");
	mDecodeLevelInterface.AddNumber(DL_Tokens, "Tokens", "Decode only the level of tokens");
	mDecodeLevelInterface.AddNumber(DL_Bytes, "Bytes", "Group the tokens into bytes");
	mDecodeLevelInterface.AddNumber(DL_Packets, "Packets", "Decode the packet contents");
	
	// set default
	mDecodeLevelInterface.SetNumber(DL_Packets);

	// add the interface
	AddInterface(&mSDAChannelInterface);
	AddInterface(&mDecodeLevelInterface);

	// describe export
	AddExportOption(0, "Export as text file");
	AddExportExtension(0, "text", "txt");

	ClearChannels();

	AddChannel(mSDAChannel,	CHANNEL_NAME, false);
}
SDIOAnalyzerSettings::SDIOAnalyzerSettings()
:	mClockChannel( UNDEFINED_CHANNEL ),
	mCmdChannel( UNDEFINED_CHANNEL ),
	mDAT0Channel( UNDEFINED_CHANNEL ),
	mDAT1Channel( UNDEFINED_CHANNEL ),
	mDAT2Channel( UNDEFINED_CHANNEL ),
	mDAT3Channel( UNDEFINED_CHANNEL )
{
	mClockChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mCmdChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mDAT0ChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mDAT1ChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mDAT2ChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mDAT3ChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );

	mClockChannelInterface->SetTitleAndTooltip( "Clock", "Standard SDIO" );
	mCmdChannelInterface->SetTitleAndTooltip( "Command", "Standard SDIO" );
	mDAT0ChannelInterface->SetTitleAndTooltip( "DAT0", "Standard SDIO" );
	mDAT1ChannelInterface->SetTitleAndTooltip( "DAT1", "Standard SDIO" );
	mDAT2ChannelInterface->SetTitleAndTooltip( "DAT2", "Standard SDIO" );
	mDAT3ChannelInterface->SetTitleAndTooltip( "DAT3", "Standard SDIO" );

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

	mClockChannelInterface->SetSelectionOfNoneIsAllowed( false );
	mCmdChannelInterface->SetSelectionOfNoneIsAllowed( false );
	mDAT0ChannelInterface->SetSelectionOfNoneIsAllowed( false );
	mDAT1ChannelInterface->SetSelectionOfNoneIsAllowed( true );
	mDAT2ChannelInterface->SetSelectionOfNoneIsAllowed( true );
	mDAT3ChannelInterface->SetSelectionOfNoneIsAllowed( true );


	AddInterface( mClockChannelInterface.get() );
	AddInterface( mCmdChannelInterface.get() );
	AddInterface( mDAT0ChannelInterface.get() );
	AddInterface( mDAT1ChannelInterface.get() );
	AddInterface( mDAT2ChannelInterface.get() );
	AddInterface( mDAT3ChannelInterface.get() );

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	// AddChannel( mInputChannel, "Serial", false );
	AddChannel( mClockChannel, "Clock", false );
	AddChannel( mCmdChannel, "Command", false );
	AddChannel( mDAT0Channel, "DAT0", false );
	AddChannel( mDAT1Channel, "DAT1", false );
	AddChannel( mDAT2Channel, "DAT2", false );
	AddChannel( mDAT3Channel, "DAT3", false );
}
示例#7
0
LD110AnalyzerSettings::LD110AnalyzerSettings() : m_oGlobalClockChannel(UNDEFINED_CHANNEL)
  {
  for(int nIndex = 0; nIndex < m_nBCDAndDigitChannelCount; nIndex++)
    {
    m_oBCDChannelInterfaceVector[nIndex].reset(new AnalyzerSettingInterfaceChannel());
    m_oBCDChannelVector.push_back(Channel(UNDEFINED_CHANNEL));

    m_oDigitChannelInterfaceVector[nIndex].reset(new AnalyzerSettingInterfaceChannel());
    m_oDigitChannelVector.push_back(Channel(UNDEFINED_CHANNEL));
    }

  m_oGlobalClockChannelInterface.reset(new AnalyzerSettingInterfaceChannel());

  for(int nIndex = 0; nIndex < m_nBCDAndDigitChannelCount; nIndex++)
    {
    m_oTitle.str("BCD Bit ");
    m_oTitle << (nIndex + 1);

    m_oTooltip.str("BCD Bit ");
    m_oTooltip << nIndex + 1 << " (Pin " << 16 - nIndex << ")";

    m_oBCDChannelInterfaceVector[nIndex]->SetTitleAndTooltip(m_oTitle.str().c_str(), m_oTooltip.str().c_str());
    m_oBCDChannelInterfaceVector[nIndex]->SetChannel(m_oBCDChannelVector[nIndex]);

    AddInterface(m_oBCDChannelInterfaceVector[nIndex].get());
    }

  for(int nIndex = 0; nIndex < m_nBCDAndDigitChannelCount; nIndex++)
    {
    m_oTitle.str("Digit ");
    m_oTitle << nIndex + 1 << " clock";

    m_oTooltip.str("The clock for digit ");
    m_oTooltip << nIndex + 1 << " (Pin " << 1 + nIndex << ")";

    m_oDigitChannelInterfaceVector[nIndex]->SetTitleAndTooltip(m_oTitle.str().c_str(), m_oTooltip.str().c_str());
    m_oDigitChannelInterfaceVector[nIndex]->SetChannel(m_oDigitChannelVector[nIndex]);

    AddInterface(m_oDigitChannelInterfaceVector[nIndex].get());
    }

  m_oGlobalClockChannelInterface.reset(new AnalyzerSettingInterfaceChannel());
  m_oGlobalClockChannelInterface->SetTitleAndTooltip("Global clock", "The clock for LD110 IC");
  m_oGlobalClockChannelInterface->SetChannel(m_oGlobalClockChannel);

  AddInterface(m_oGlobalClockChannelInterface.get());

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
  AddChannels();
  }
HdmiCecAnalyzerSettings::HdmiCecAnalyzerSettings()
:	mCecChannel( UNDEFINED_CHANNEL )
{
    mCecChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
    mCecChannelInterface->SetTitleAndTooltip( HdmiCec::GetChannelName(), HdmiCec::GetFullProtocolName() );
    mCecChannelInterface->SetChannel( mCecChannel );

    AddInterface( mCecChannelInterface.get() );

    AddExportOption( 0, "Export as text/csv file" );
    AddExportExtension( 0, "text", "txt" );
    AddExportExtension( 0, "csv", "csv" );

    ClearChannels();
    AddChannel( mCecChannel, HdmiCec::GetProtocolName(), false );
}
USBAnalyzerSettings::USBAnalyzerSettings()
:	mDMChannel(UNDEFINED_CHANNEL),
	mDPChannel(UNDEFINED_CHANNEL),
	mSpeed(LOW_SPEED),
	mDecodeLevel(OUT_PACKETS)
{
	// init the interface
	mDPChannelInterface.SetTitleAndTooltip("D+", "USB D+ (green)");
	mDPChannelInterface.SetChannel(mDPChannel);

	mDMChannelInterface.SetTitleAndTooltip("D-", "USB D- (white)");
	mDMChannelInterface.SetChannel(mDMChannel);

	mSpeedInterface.SetTitleAndTooltip("USB bit-rate", "USB data bit-rate");
	mSpeedInterface.AddNumber(LOW_SPEED, "Low speed (1.5 Mbps)", "Low speed (1.5 mbit/s)");
	mSpeedInterface.AddNumber(FULL_SPEED, "Full speed (12 Mbps)", "Full speed (12 mbit/s)");

	mSpeedInterface.SetNumber(mSpeed);

	mDecodeLevelInterface.SetTitleAndTooltip("USB decode level", "Type of decoded USB output");
	mDecodeLevelInterface.AddNumber(OUT_PACKETS, "Packets", "Decode all the fields of USB packets");
	mDecodeLevelInterface.AddNumber(OUT_BYTES, "Bytes", "Decode the data as raw bytes");
	mDecodeLevelInterface.AddNumber(OUT_SIGNALS, "Signals", "Decode the USB signal states: J, K and SE0");

	mDecodeLevelInterface.SetNumber(OUT_PACKETS);

	// add the interface
	AddInterface(&mDPChannelInterface);
	AddInterface(&mDMChannelInterface);
	AddInterface(&mSpeedInterface);
	AddInterface(&mDecodeLevelInterface);

	// describe export
	AddExportOption(0, "Export as text file");
	AddExportExtension(0, "text", "txt");

	ClearChannels();

	AddChannel(mDPChannel, "D+", false);
	AddChannel(mDMChannel, "D-", false);
}
QuadratureAnalyserAnalyzerSettings::QuadratureAnalyserAnalyzerSettings()
:	mInputChannelA( UNDEFINED_CHANNEL ),
	mInputChannelB( UNDEFINED_CHANNEL ),
	ticksPerRotation( 0 )
{
	mInputChannelAInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mInputChannelAInterface->SetTitleAndTooltip( "Quadrature A", "Standard Quadrature Decoder - input A (or left/cw/first)" );
	mInputChannelAInterface->SetChannel( mInputChannelA );

	mInputChannelBInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mInputChannelBInterface->SetTitleAndTooltip( "Quadrature B", "Standard Quadrature Decoder - input Bi (or right/ccw/last)" );
	mInputChannelBInterface->SetChannel( mInputChannelB );

	mTicksPerRotationInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mTicksPerRotationInterface->SetTitleAndTooltip( "Impules/rotation",  
		"Specify the number of changes per full revolution (or some other measure). Set to '0' to ignore - and not do speed/change calculations.");
	mTicksPerRotationInterface->SetMax( 1e12 );
	mTicksPerRotationInterface->SetMin( 0 );
	mTicksPerRotationInterface->SetInteger( ticksPerRotation);
	
	mTicksPerFrameInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mTicksPerFrameInterface->SetTitleAndTooltip( "Max Impules/Frame",  
		"Specify the maximum number of changes per Frame. Set to '0' to ignore - only use direction changes.");
	mTicksPerFrameInterface->SetMax( 1e12 );
	mTicksPerFrameInterface->SetMin( 0 );
	mTicksPerFrameInterface->SetInteger( ticksPerFrame);

	AddInterface( mInputChannelAInterface.get() );
	AddInterface( mInputChannelBInterface.get() );
	AddInterface( mTicksPerRotationInterface.get() );
	AddInterface( mTicksPerFrameInterface.get() );

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mInputChannelA, "Quadrature A", false );
	AddChannel( mInputChannelB, "Quadrature B", false );
}
SWDAnalyzerSettings::SWDAnalyzerSettings()
:	mSWDIOChannel( UNDEFINED_CHANNEL ),
	mSWCLKChannel( UNDEFINED_CHANNEL )
{
	mSWDIOChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mSWDIOChannelInterface->SetTitleAndTooltip( "SWDIO", "SWDIO" );
	mSWDIOChannelInterface->SetChannel( mSWDIOChannel );

	mSWCLKChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mSWCLKChannelInterface->SetTitleAndTooltip( "SWCLK", "SWCLK" );
	mSWCLKChannelInterface->SetChannel( mSWCLKChannel );

	AddInterface( mSWDIOChannelInterface.get() );
	AddInterface( mSWCLKChannelInterface.get() );

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mSWDIOChannel, "SWDIO", false );
	AddChannel( mSWCLKChannel, "SWCLK", false );
}
MDIOAnalyzerSettings::MDIOAnalyzerSettings()
:	mMdioChannel( UNDEFINED_CHANNEL ),
	mMdcChannel( UNDEFINED_CHANNEL )
{
	mMdioChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mMdioChannelInterface->SetTitleAndTooltip( "MDIO", "MDIO data bus" );
	mMdioChannelInterface->SetChannel( mMdioChannel );

	mMdcChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mMdcChannelInterface->SetTitleAndTooltip( "MDC", "MDIO clock line " );
	mMdcChannelInterface->SetChannel( mMdcChannel );

	AddInterface( mMdioChannelInterface.get() );
	AddInterface( mMdcChannelInterface.get() );
	
	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mMdioChannel, "MDIO", false );
	AddChannel( mMdcChannel, "MDC", false );
}
NeopixelAnalyzerSettings::NeopixelAnalyzerSettings()
:	mInputChannel( UNDEFINED_CHANNEL ),
	mBitRate( 800 )
{
	mInputChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mInputChannelInterface->SetTitleAndTooltip( "Serial", "Standard Neopixel" );
	mInputChannelInterface->SetChannel( mInputChannel );

	mBitRateInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mBitRateInterface->SetTitleAndTooltip( "Bit Rate (kBits/S)",  "Specify the bit rate in kilobits per second." );
	mBitRateInterface->SetMax( 800 );
	mBitRateInterface->SetMin( 400 );
	mBitRateInterface->SetInteger( mBitRate );

	AddInterface( mInputChannelInterface.get() );
	AddInterface( mBitRateInterface.get() );

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mInputChannel, "Serial", false );
}
SPDIFAnalyzerSettings::SPDIFAnalyzerSettings()
:	mInputChannel( UNDEFINED_CHANNEL ),
	mSampleRate( 48000 )
{
	mInputChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mInputChannelInterface->SetTitleAndTooltip( "SPDIF", "Standard S/PDIF" );
	mInputChannelInterface->SetChannel( mInputChannel );

	mSampleRateInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mSampleRateInterface->SetTitleAndTooltip( "Audio sample rate (Samples/S)",  "Specify audio rate in frames per second." );
	mSampleRateInterface->SetMax( 48000 );
	mSampleRateInterface->SetMin( 8000 );
	mSampleRateInterface->SetInteger( mSampleRate );

	AddInterface( mInputChannelInterface.get() );
	AddInterface( mSampleRateInterface.get() );

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mInputChannel, "SPDIF", false );
}
Xlink2WAnalyzerSettings::Xlink2WAnalyzerSettings()
:   chanW0( UNDEFINED_CHANNEL ),
    chanW1( UNDEFINED_CHANNEL )
{
    chanW0Interface.reset( new AnalyzerSettingInterfaceChannel() );
    chanW0Interface->SetTitleAndTooltip( "XLINK Wire 0", "XLINK Wire 0" );
    chanW0Interface->SetChannel( chanW0 );
    
    chanW1Interface.reset( new AnalyzerSettingInterfaceChannel() );
    chanW1Interface->SetTitleAndTooltip( "XLINK Wire 1", "XLINK Wire 1" );
    chanW1Interface->SetChannel( chanW1 );

    AddInterface( chanW0Interface.get() );
    AddInterface( chanW1Interface.get() );

    AddExportOption( 0, "Export as text/csv file" );
    AddExportExtension( 0, "text", "txt" );
    AddExportExtension( 0, "csv", "csv" );

    ClearChannels();
    AddChannel( chanW0, "XLINK Wire 0", false );
    AddChannel( chanW1, "XLINK Wire 1", false );

}
SpiAnalyzerSettings::SpiAnalyzerSettings()
:	mMosiChannel( UNDEFINED_CHANNEL ),
	mMisoChannel( UNDEFINED_CHANNEL ),
	mClockChannel( UNDEFINED_CHANNEL ),
	mEnableChannel( UNDEFINED_CHANNEL ),
	mShiftOrder( AnalyzerEnums::MsbFirst ),
	mBitsPerTransfer( 8 ),
	mClockInactiveState( BIT_LOW ),
	mDataValidEdge( AnalyzerEnums::LeadingEdge ), 
	mEnableActiveState( BIT_LOW )
{
	mMosiChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mMosiChannelInterface->SetTitleAndTooltip( "MOSI", "Master Out, Slave In" );
	mMosiChannelInterface->SetChannel( mMosiChannel );
	mMosiChannelInterface->SetSelectionOfNoneIsAllowed( true );

	mMisoChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mMisoChannelInterface->SetTitleAndTooltip( "MISO", "Master In, Slave Out" );
	mMisoChannelInterface->SetChannel( mMisoChannel );
	mMisoChannelInterface->SetSelectionOfNoneIsAllowed( true );

	mClockChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mClockChannelInterface->SetTitleAndTooltip( "Clock", "Clock (CLK)" );
	mClockChannelInterface->SetChannel( mClockChannel );

	mEnableChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mEnableChannelInterface->SetTitleAndTooltip( "Enable", "Enable (SS, Slave Select)" );
	mEnableChannelInterface->SetChannel( mEnableChannel );
	mEnableChannelInterface->SetSelectionOfNoneIsAllowed( true );

	mShiftOrderInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mShiftOrderInterface->SetTitleAndTooltip( "", "" );
	mShiftOrderInterface->AddNumber( AnalyzerEnums::MsbFirst, "Most Significant Bit First (Standard)", "" );
	mShiftOrderInterface->AddNumber( AnalyzerEnums::LsbFirst, "Least Significant Bit First", "" );
	mShiftOrderInterface->SetNumber( mShiftOrder );

	mBitsPerTransferInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mBitsPerTransferInterface->SetTitleAndTooltip( "", "" );
	for( U32 i=1; i<=64; i++ )
	{
		std::stringstream ss;

		if( i == 8 )
			ss << "8 Bits per Transfer (Standard)";
		else
			ss << i << " Bits per Transfer";
		
		mBitsPerTransferInterface->AddNumber( i, ss.str().c_str(), "" );
	}
	mBitsPerTransferInterface->SetNumber( mBitsPerTransfer );

	mClockInactiveStateInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mClockInactiveStateInterface->SetTitleAndTooltip( "", "" );
	mClockInactiveStateInterface->AddNumber( BIT_LOW, "Clock is Low when inactive (CPOL = 0)", "CPOL = 0 (Clock Polarity)" );
	mClockInactiveStateInterface->AddNumber( BIT_HIGH, "Clock is High when inactive (CPOL = 1)", "CPOL = 1 (Clock Polarity)" );
	mClockInactiveStateInterface->SetNumber( mClockInactiveState );

	mDataValidEdgeInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mDataValidEdgeInterface->SetTitleAndTooltip( "", "" );
	mDataValidEdgeInterface->AddNumber( AnalyzerEnums::LeadingEdge, "Data is Valid on Clock Leading Edge (CPHA = 0)", "CPHA = 0 (Clock Phase)" );
	mDataValidEdgeInterface->AddNumber( AnalyzerEnums::TrailingEdge, "Data is Valid on Clock Trailing Edge (CPHA = 1)", "CPHA = 1 (Clock Phase)" );
	mDataValidEdgeInterface->SetNumber( mDataValidEdge );

	mEnableActiveStateInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mEnableActiveStateInterface->SetTitleAndTooltip( "", "" );
	mEnableActiveStateInterface->AddNumber( BIT_LOW, "Enable line is Active Low (Standard)", "" );
	mEnableActiveStateInterface->AddNumber( BIT_HIGH, "Enable line is Active High", "" );
	mEnableActiveStateInterface->SetNumber( mEnableActiveState );


	AddInterface( mMosiChannelInterface.get() );
	AddInterface( mMisoChannelInterface.get() );
	AddInterface( mClockChannelInterface.get() );
	AddInterface( mEnableChannelInterface.get() );
	AddInterface( mShiftOrderInterface.get() );
	AddInterface( mBitsPerTransferInterface.get() );
	AddInterface( mClockInactiveStateInterface.get() );
	AddInterface( mDataValidEdgeInterface.get() );
	AddInterface( mEnableActiveStateInterface.get() );


	//AddExportOption( 0, "Export as text/csv file", "text (*.txt);;csv (*.csv)" );
	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mMosiChannel, "MOSI", false );
	AddChannel( mMisoChannel, "MISO", false );
	AddChannel( mClockChannel, "CLOCK", false );
	AddChannel( mEnableChannel, "ENABLE", false );
}
ManchesterAnalyzerSettings::ManchesterAnalyzerSettings()
:	mInputChannel( UNDEFINED_CHANNEL ),
	mMode( MANCHESTER ),
	mBitRate( 1500 ),
	mInverted( false ),
	mBitsPerTransfer( 8 ),
	mShiftOrder( AnalyzerEnums::LsbFirst ),
	mBitsToIgnore( 0 ),
	mTolerance( TOL25 )
{
	mInputChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mInputChannelInterface->SetTitleAndTooltip( "Manchester", "Manchester" );
	mInputChannelInterface->SetChannel( mInputChannel );

	mModeInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mModeInterface->SetTitleAndTooltip( "Mode", "Specify the Manchester Mode" );
	mModeInterface->AddNumber( MANCHESTER, "Manchester", "" );
	mModeInterface->AddNumber( DIFFERENTIAL_MANCHESTER, "Differential Manchester", "" );
	mModeInterface->AddNumber( BI_PHASE_MARK, "Bi-Phase Mark Code (FM1)", "" );
	mModeInterface->AddNumber( BI_PHASE_SPACE, "Bi-Phase Space Code (FM0)", "" );
	mModeInterface->SetNumber( mMode );

	mBitRateInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mBitRateInterface->SetTitleAndTooltip( "Bit Rate (Bits/S)",  "Specify the bit rate in bits per second." );
	mBitRateInterface->SetMax( 6000000 );
	mBitRateInterface->SetMin( 1 );
	mBitRateInterface->SetInteger( mBitRate );

	mInvertedInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mInvertedInterface->SetTitleAndTooltip( "", "Specify the Manchester edge polarity (Normal Manchester mode only)" );
	mInvertedInterface->AddNumber( false, "negative edge is binary one", "" );
	mInvertedInterface->AddNumber( true, "negative edge is binary zero", "" );
	mInvertedInterface->SetNumber( mInverted );

	mBitsPerTransferInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mBitsPerTransferInterface->SetTitleAndTooltip( "", "Select the number of bits per frame" ); 
	for( U32 i = 1; i <= 64; i++ )
	{
		std::stringstream ss; 

		if( i == 1 )
			ss << "1 Bit per Transfer";
		else
			ss << i << " Bits per Transfer";

		mBitsPerTransferInterface->AddNumber( i, ss.str().c_str(), "" );
	}
	mBitsPerTransferInterface->SetNumber( mBitsPerTransfer );

	mShiftOrderInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mShiftOrderInterface->SetTitleAndTooltip( "", "Select if the most significant bit or least significant bit is transmitted first" );
	mShiftOrderInterface->AddNumber( AnalyzerEnums::LsbFirst, "Least Significant Bit Sent First", "" );
	mShiftOrderInterface->AddNumber( AnalyzerEnums::MsbFirst, "Most Significant Bit Sent First", "" );
	mShiftOrderInterface->SetNumber( mShiftOrder );


	mNumBitsIgnoreInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mNumBitsIgnoreInterface->SetTitleAndTooltip( "Preamble bits to ignore",  "Specify the number of preamble bits to ignore." );
	mNumBitsIgnoreInterface->SetMax( 1000 );
	mNumBitsIgnoreInterface->SetMin( 0 );
	mNumBitsIgnoreInterface->SetInteger( mBitsToIgnore );

	mToleranceInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mToleranceInterface->SetTitleAndTooltip( "Tolerance", "Specify the Manchester Tolerance as a percentage of period" );
	mToleranceInterface->AddNumber( TOL25, "25% of period (default)", "Maximum allowed tolerance, +- 50% of one half period" );
	mToleranceInterface->AddNumber( TOL5, "5% of period", "Required more than 10x over sampling" );
	mToleranceInterface->AddNumber( TOL05, "0.5% of period", "Requires more than 200x over sampling" );
	mToleranceInterface->SetNumber( mTolerance );

	AddInterface( mInputChannelInterface.get() );
	AddInterface( mModeInterface.get() );
	AddInterface( mBitRateInterface.get() );
	AddInterface( mInvertedInterface.get() );
	AddInterface( mBitsPerTransferInterface.get() );
	AddInterface( mShiftOrderInterface.get() );
	AddInterface( mNumBitsIgnoreInterface.get() );
	AddInterface( mToleranceInterface.get() );

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mInputChannel, "Manchester", false );
}
SerialAnalyzerSettings::SerialAnalyzerSettings()
:	mInputChannel( UNDEFINED_CHANNEL ),
	mBitRate( 9600 ),
	mBitsPerTransfer( 8 ),
	mStopBits( 1.0 ),
	mParity( AnalyzerEnums::None ),
	mShiftOrder( AnalyzerEnums::LsbFirst ),
	mInverted( false ),
	mUseAutobaud( false ),
	mSerialMode( SerialAnalyzerEnums::Normal )
{
	mInputChannelInterface.reset( new AnalyzerSettingInterfaceChannel() );
	mInputChannelInterface->SetTitleAndTooltip( "Serial", "Standard Async Serial" );
	mInputChannelInterface->SetChannel( mInputChannel );

	mBitRateInterface.reset( new AnalyzerSettingInterfaceInteger() );
	mBitRateInterface->SetTitleAndTooltip( "Bit Rate (Bits/S)",  "Specify the bit rate in bits per second." );
	mBitRateInterface->SetMax( 100000000 );
	mBitRateInterface->SetMin( 1 );
	mBitRateInterface->SetInteger( mBitRate );

	mUseAutobaudInterface.reset( new AnalyzerSettingInterfaceBool() );
	mUseAutobaudInterface->SetTitleAndTooltip( "", "With Autobaud turned on, the analyzer will run as usual, with the current bit rate.  At the same time, it will also keep track of the shortest pulse it detects. \nAfter analyzing all the data, if the bit rate implied by this shortest pulse is different by more than 10% from the specified bit rate, the bit rate will be changed and the analysis run again." );
	mUseAutobaudInterface->SetCheckBoxText( "Use Autobaud" );
	mUseAutobaudInterface->SetValue( mUseAutobaud );

	mBitsPerTransferInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mBitsPerTransferInterface->SetTitleAndTooltip( "", "Select the number of bits per frame" ); 
	for( U32 i = 1; i <= 64; i++ )
	{
		std::stringstream ss; 

		if( i == 1 )
			ss << "1 Bit per Transfer";
		else
			if( i == 8 )
				ss << "8 Bits per Transfer (Standard)";
			else
				ss << i << " Bits per Transfer";

		mBitsPerTransferInterface->AddNumber( i, ss.str().c_str(), "" );
	}
	mBitsPerTransferInterface->SetNumber( mBitsPerTransfer );


	mStopBitsInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mStopBitsInterface->SetTitleAndTooltip( "", "Specify the number of stop bits." );
	mStopBitsInterface->AddNumber( 1.0, "1 Stop Bit (Standard)", "" );
	mStopBitsInterface->AddNumber( 1.5, "1.5 Stop Bits", "" );
	mStopBitsInterface->AddNumber( 2.0, "2 Stop Bits", "" );
	mStopBitsInterface->SetNumber( mStopBits ); 


	mParityInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mParityInterface->SetTitleAndTooltip( "", "Specify None, Even, or Odd Parity." );
	mParityInterface->AddNumber( AnalyzerEnums::None, "No Parity Bit (Standard)", "" );
	mParityInterface->AddNumber( AnalyzerEnums::Even, "Even Parity Bit", "" );
	mParityInterface->AddNumber( AnalyzerEnums::Odd, "Odd Parity Bit", "" ); 
	mParityInterface->SetNumber( mParity );


	mShiftOrderInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mShiftOrderInterface->SetTitleAndTooltip( "", "Select if the most significant bit or least significant bit is transmitted first" );
	mShiftOrderInterface->AddNumber( AnalyzerEnums::LsbFirst, "Least Significant Bit Sent First (Standard)", "" );
	mShiftOrderInterface->AddNumber( AnalyzerEnums::MsbFirst, "Most Significant Bit Sent First", "" );
	mShiftOrderInterface->SetNumber( mShiftOrder );


	mInvertedInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mInvertedInterface->SetTitleAndTooltip( "", "Specify if the serial signal is inverted" );
	mInvertedInterface->AddNumber( false, "Non Inverted (Standard)", "" );
	mInvertedInterface->AddNumber( true, "Inverted", "" );

	mInvertedInterface->SetNumber( mInverted );enum Mode { Normal, MpModeRightZeroMeansAddress, MpModeRightOneMeansAddress, MpModeLeftZeroMeansAddress, MpModeLeftOneMeansAddress };

	mSerialModeInterface.reset( new AnalyzerSettingInterfaceNumberList() );
	mSerialModeInterface->SetTitleAndTooltip( "Special Mode", "Specify if this is normal, or MP serial (aka multi-drop, MP, multi-processor, 9-bit serial)" );
	mSerialModeInterface->AddNumber( SerialAnalyzerEnums::Normal, "None", "" );
	mSerialModeInterface->AddNumber( SerialAnalyzerEnums::MpModeMsbZeroMeansAddress, "MP Mode: Address indicated by MSB=0", "(aka MP, multi-processor, 9-bit serial)" );
	mSerialModeInterface->AddNumber( SerialAnalyzerEnums::MpModeMsbOneMeansAddress, "MDB Mode: Address indicated by MSB=1", "(aka multi-drop, 9-bit serial)" );
	mSerialModeInterface->SetNumber( mSerialMode );

	AddInterface( mInputChannelInterface.get() );
	AddInterface( mBitRateInterface.get() );
	AddInterface( mUseAutobaudInterface.get() );
	AddInterface( mBitsPerTransferInterface.get() );
	AddInterface( mStopBitsInterface.get() );
	AddInterface( mParityInterface.get() );
	AddInterface( mShiftOrderInterface.get() );
	AddInterface( mInvertedInterface.get() );
	AddInterface( mSerialModeInterface.get() );

	//AddExportOption( 0, "Export as text/csv file", "text (*.txt);;csv (*.csv)" );
	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
	AddChannel( mInputChannel, "Serial", false );
}