コード例 #1
0
ファイル: qucsfilter.cpp プロジェクト: VolkerChristian/qucs
// ************************************************************
void QucsFilter::slotClassChanged(int index)
{
  FlushImage();
  switch(index) {
    case CLASS_LOWPASS:
    case CLASS_HIGHPASS:
      LabelStop->setEnabled(false);
      EditStop->setEnabled(false);
      ComboStop->setEnabled(false);
      LabelStart->setText(tr("Corner frequency:"));
      break;
    case CLASS_BANDPASS:
    case CLASS_BANDSTOP:
      LabelStop->setEnabled(true);
      EditStop->setEnabled(true);
      ComboStop->setEnabled(true);
      break;
  }
  if (index == CLASS_BANDPASS) {
    LabelBandStop->setText(tr("Stop band frequency:"));
    LabelRipple->setText(tr("Pass band ripple:"));
  }
  else if (index == CLASS_BANDSTOP) {
    LabelBandStop->setText(tr("Pass band frequency:"));
    LabelRipple->setText(tr("Pass band attenuation:"));
  }
}
コード例 #2
0
void cGraphicsDrawer::DrawGfxObject(cGfxObject* apObject, const cVector3f& avPos)
{
    FlushImage(apObject);

    cGfxBufferObject BuffObj;
    BuffObj.mpObject = apObject;
    BuffObj.mvTransform = avPos;
    BuffObj.mbIsColorAndSize = false;

    m_setGfxBuffer.insert(BuffObj);
}
コード例 #3
0
void cGraphicsDrawer::DrawGfxObject(cGfxObject* apObject, const cVector3f& avPos,
                                    const cVector2f& avSize, const cColor& aColor,
                                    bool abFlipH, bool abFlipV, float afAngle)
{
    FlushImage(apObject);

    cGfxBufferObject BuffObj;
    BuffObj.mpObject = apObject;
    BuffObj.mvTransform = avPos;
    BuffObj.mvSize= avSize;
    BuffObj.mColor = aColor;
    BuffObj.mbFlipH = abFlipH;
    BuffObj.mbFlipV = abFlipV;
    BuffObj.mfAngle = afAngle;

    BuffObj.mbIsColorAndSize = true;

    m_setGfxBuffer.insert(BuffObj);
}
コード例 #4
0
ファイル: qucsfilter.cpp プロジェクト: VolkerChristian/qucs
// ************************************************************
void QucsFilter::slotTypeChanged(int index)
{
  FlushImage();
  switch(index) {
    case TYPE_BESSEL:
    case TYPE_BUTTERWORTH:
	LabelRipple->setEnabled(false);
	EditRipple->setEnabled(false);
	LabelRipple_dB->setEnabled(false);
	break;
    case TYPE_CHEBYSHEV:
    case TYPE_CAUER:
	LabelRipple->setEnabled(true);
	EditRipple->setEnabled(true);
	LabelRipple_dB->setEnabled(true);
	break;
  }
  if (index == TYPE_CAUER) {
    LabelOrder->setEnabled(false);
    EditOrder->setEnabled(false);
    LabelAtten->setEnabled(true);
    EditAtten->setEnabled(true);
    LabelAtten_dB->setEnabled(true);
    LabelBandStop->setEnabled(true);
    EditBandStop->setEnabled(true);
    ComboBandStop->setEnabled(true);
  }
  else {
    LabelOrder->setEnabled(true);
    EditOrder->setEnabled(true);
    LabelAtten->setEnabled(false);
    EditAtten->setEnabled(false);
    LabelAtten_dB->setEnabled(false);
    LabelBandStop->setEnabled(false);
    EditBandStop->setEnabled(false);
    ComboBandStop->setEnabled(false);
  }
}
コード例 #5
0
ファイル: qucsfilter.cpp プロジェクト: VolkerChristian/qucs
void QucsFilter::on_MicrostripcheckBox_clicked()
{
    FlushImage();
    bool microcheck = MicrostripcheckBox->isChecked();
    box2->setEnabled(microcheck);
}
コード例 #6
0
ファイル: qucsfilter.cpp プロジェクト: VolkerChristian/qucs
// ************************************************************
void QucsFilter::slotRealizationChanged(int index)
{
  FlushImage();

  if (index < 2)//LC filters
  {
     ComboType->clear();
     ComboType->addItem("Bessel");
     ComboType->addItem("Butterworth");
     ComboType->addItem("Chebyshev");
     ComboType->addItem("Cauer");
     MicrostripcheckBox->setEnabled(false);
     MicrostripcheckBox->setChecked(false);
     box2->setEnabled(false);//Microstrip substrate definition panel
     ComboClass->setEnabled(true);
     EditOrder->setEnabled(true);
     ComboType->setEnabled(true);//The other filters can implement canonical responses
     LabelStart->setText(tr("Corner frequency:"));
     LabelStop->setText(tr("Stop frequency:"));
     return;
  }

  //Remove Cauer filters from ComboClass since they cannot be implemented with the other topologies
  //Otherwise, the user may select it and face a number of annoying warnings...
  ComboType->clear();
  ComboType->addItem("Bessel");
  ComboType->addItem("Butterworth");
  ComboType->addItem("Chebyshev");


  //Shared settings for microwave BP filters
  if ((index == 2) || (index == 3) || (index == 5) || (index == 6))
  {
           ComboClass->setCurrentIndex(CLASS_BANDPASS);
           slotClassChanged(CLASS_BANDPASS);
           ComboClass->setEnabled(false);
           MicrostripcheckBox->setEnabled(true);
           MicrostripcheckBox->setChecked(false);//By default, the microstrip implementation is unchecked
           box2->setEnabled(false);//Microstrip substrate definition panel
  }
  
  if (index == 4)//Stepped impedance LPF
  {
     ComboClass->setCurrentIndex(CLASS_LOWPASS);
     slotClassChanged(CLASS_LOWPASS);
     ComboClass->setEnabled(false);
     MicrostripcheckBox->setEnabled(true);
     MicrostripcheckBox->setChecked(false);//By default, the microstrip implementation is unchecked
     box2->setEnabled(false);//Microstrip substrate definition panel
  }

  if (index == 6)//Quarter wavelength side coupled ring resonator (BP)
  {
     ComboType->setEnabled(false);//Conventional frequency responses not available
     EditOrder->setEnabled(false);//Not possible to modify the order
     LabelStart->setText("1st transmission zero frequency:");
     LabelStop->setText("2nd transmission zero frequency:");
  }
  else
  {
     EditOrder->setEnabled(true);
     ComboType->setEnabled(true);//The other filters can implement canonical responses
     LabelStart->setText(tr("Corner frequency:"));
     LabelStop->setText(tr("Stop frequency:"));
  }

  //Shared settings for the qw-ring resonator and the capacitively coupled shunt resonators
  if ((index == 6)||(index == 7))
  {
    MicrostripcheckBox->setEnabled(false);//Microstrip implementation does not work...
    ComboClass->setCurrentIndex(CLASS_BANDPASS);
    slotClassChanged(CLASS_BANDPASS);
    ComboClass->setEnabled(false);
  }

  if (index == 8)//RF EDD filter
  {
     MicrostripcheckBox->setEnabled(false);
     MicrostripcheckBox->setChecked(false);
     ComboClass->setEnabled(true);
     ComboType->setEnabled(true);
  }

} 
コード例 #7
0
void LidilCompress::CompressData (Int16 compressionmode)
{
    Int16   i;
    UInt16  *in_ptr;
    UInt16  in;
    UInt16  last=0;
    UInt16  copy_item;
    UInt16  data_length;

    LDLCOMPMODE mode = IN_NOT;


    m_out_cnt = 0;
    m_image_cnt = 0;
    m_copy_cnt = 0;

    m_out_ptr = &m_out_array[8];
    data_length = m_data_length;

    if ((data_length & 1) != 0)
    {
    //    ErrorTrap((char *)"Data length is odd.");
    }

    copy_item = 0;
    in_ptr = &m_raw_data[0];

    for (i=0; i<data_length; i+=2)
    {
        in = *in_ptr;

        switch(mode)
        {
            case IN_NOT:
            {
                /* default the first entry to 'image' */
                last = in;
                m_image_ptr = in_ptr;
                m_image_cnt = 1;
                mode = IN_FIRST;
                break;
            }

            case IN_FIRST:
            {
#if ALLOW_FILL_NEXT_CMD
                if (last == in)
#else
                if ((last == in) && ((in==0xFFFF) || (in == 0)) )
#endif
                {
                    mode = IN_COPY;
                    m_copy_cnt = 2;
                    m_image_cnt = 0;
                    copy_item = in;
                }
                else
                {
                    mode = IN_IMAGE;
                    m_image_cnt++;
                    last = in;
                }
                break;
            }

            case IN_COPY:
            {
                if (last == in)
                {
                    m_copy_cnt++;
                }
                else
                {
                    /* revisit - could allow 2 words of copy if the data is
                    0000 or FFFF */

                    /* convert a copy cnt of 2 to an image */
                    UInt16 copy_count = m_copy_cnt;

                    if (copy_count <= m_run_length)
                    {
                        if (m_image_cnt == 0)
                        {
                            /* point the pointer to the first element */
                            m_image_ptr = in_ptr - copy_count;
                        }
                        m_image_cnt += (1+copy_count);
                     m_copy_cnt = 0;
                    }
                    else
                    {
                        /* have enough to be a legal copy */

                        (void) FlushImage ();

                        (void) FlushCopy (copy_item);

                        m_image_ptr = in_ptr;
                        m_image_cnt = 1;
                    }
                    mode = IN_IMAGE;
                    last = in;
                }
                break;
            }

            case IN_IMAGE:
            {
#if ALLOW_FILL_NEXT_CMD
                if (last == in)
#else
                if ((last == in) && ((in==0xFFFF) || (in == 0)) )
#endif
                {
                    m_image_cnt--;

                    mode = IN_COPY;
                    copy_item = in;
                    m_copy_cnt = 2;
                }
                else /* different */
                {
                    last = in;
                    m_image_cnt++;
                }
                break;
            }

            default:
            {
                break;
            }
        }
        in_ptr++;
    } /* next data - end of processing */

    /* flush out the remainder */

    switch(mode)
    {
        case IN_COPY:
        {
            /* have enough to be a legal copy */
            (void) FlushImage ();

            (void) FlushCopy (copy_item);
            break;
        }
        case IN_IMAGE:
        case IN_FIRST:
        {
            (void) FlushImage ();
            break;
        }
        default:
            break;
    }

    if (m_out_cnt > 2048+16)
    {
    //    ErrorTrap("out cnt too big");
    //    exit (-7);
    }
}