Logo Search packages:      
Sourcecode: qantenna version File versions  Download package

void NECInput::ProcessData (  ) 

The function ProcessData is the start of the information procedure. It converts data stored in elementList to a primitive format, more apropiate to process it. Then it call ProcessLine function.

FIXME We will have to re write this... Ask Gustavo if in doubt...

Definition at line 557 of file necinput.cpp.

References Line::CalculateMaxModule(), cardsList, CompareModule(), foundFRCard, frequency, GACard::getArcRadius(), GACard::getFirstEndAngle(), FRCard::getFrequency(), GMCard::getInitialTag(), GMCard::getNumberOfNewStructures(), GRCard::getNumberOfOcurrencies(), GACard::getNumberOfSegments(), GXCard::getReflectionFlags(), GACard::getSecondEndAngle(), GACard::getTagNumber(), GWCard::getTagNumber(), GRCard::getTagNumberIncrement(), GXCard::getTagNumberIncrement(), GMCard::getTagNumberIncrement(), GACard::getWireRadius(), GMCard::getXRotationAngle(), GMCard::getXTranslation(), GWCard::getXWire1(), GWCard::getXWire2(), GMCard::getYRotationAngle(), GMCard::getYTranslation(), GWCard::getYWire1(), GWCard::getYWire2(), GMCard::getZRotationAngle(), GMCard::getZTranslation(), GWCard::getZWire1(), GWCard::getZWire2(), primitiveList, ProcessPrimitive(), ProcessSPCard(), and FRCard::setFrequency().

{
      // We clean the primitive list
      qDeleteAll(primitiveList);
      primitiveList.clear();

      Line* newLine = 0;

      // Some pointers
      GenericCard * card = 0;
      GMCard * gmcard = 0;
      GXCard * gxcard = 0;
      GRCard * grcard = 0;
      GWCard * gwcard = 0;
      GACard * gacard = 0;
      FRCard * frcard = 0;

      QVector<double> end1;
      // We create three values
      end1.append(0.0);
      end1.append(0.0);
      end1.append(0.0);

      QVector<double> end2;
      // We create three values
      end2.append(0.0);
      end2.append(0.0);
      end2.append(0.0);

      for( int i=0; i<cardsList.size() ; i++)
      {
            card = cardsList.at(i);
            // Variable cleaning
            end1[0] = 0.0;
            end1[1] = 0.0;
            end1[2] = 0.0;
            end2[0] = 0.0;
            end2[1] = 0.0;
            end2[2] = 0.0;

            if(card->getCardType() == "GM")
            {
                  /*
                  In this card tagNumber contains the tag increment.
                  CardParameter is the number of new structures created.
                  CardParameter1 is the start of the transformed structure.
                  End1 contains rotation angles and end2 the new position.
                  */
                  gmcard = (GMCard*)cardsList.at(i);
                  end1[0] = gmcard->getXRotationAngle();
                  end1[1] = gmcard->getYRotationAngle();
                  end1[2] = gmcard->getZRotationAngle();

                  end2[0] = gmcard->getXTranslation();
                  end2[1] = gmcard->getYTranslation();
                  end2[2] = gmcard->getZTranslation();

                  newLine = new Line("GM", end1, end2,gmcard->getTagNumberIncrement(),
                                     gmcard->getNumberOfNewStructures(),
                                     (int)gmcard->getInitialTag());
                  primitiveList.append(newLine);
                  gmcard = 0;
            }
            else if(card->getCardType() == "GX")
            {
                  /*
                        In this card tagNumber contains tag increment.
                        Card parameter indicates which are the reflexion planes.
                  */
                  gxcard = (GXCard*)cardsList.at(i);
                  newLine = new Line("GX", end1, end2,gxcard->getTagNumberIncrement(),gxcard->getReflectionFlags(), 0);
                  primitiveList.append(newLine);
                  gxcard = 0;
            }
            // This card is trated as a particular case of GM card (see NEC2 tutorial).
            else if(card->getCardType() == "GR")
            {
                  /*
                        In this card tagNumber contains tag increment.
                        CardParameter indicates how many new structures are built.
                  */
                  grcard = (GRCard*)cardsList.at(i);
                  double roz = 360/grcard->getNumberOfOcurrencies();
                  end1[0] = roz;
                  newLine = new Line("GM", end1, end2, grcard->getTagNumberIncrement(), grcard->getNumberOfOcurrencies()-1, 0);
                  primitiveList.append(newLine);
                  grcard = 0;
            }
            else if (card->getCardType() == "GW")
            {
                  gwcard = (GWCard*)cardsList.at(i);

                  end1[0] = gwcard->getXWire1();
                  end1[1] = gwcard->getYWire1();
                  end1[2] = gwcard->getZWire1();

                  end2[0] = gwcard->getXWire2();
                  end2[1] = gwcard->getYWire2();
                  end2[2] = gwcard->getZWire2();

                  newLine = new Line("GW", end1, end2, gwcard->getTagNumber(), 0, 0 );
                  CompareModule(newLine->CalculateMaxModule());
                  primitiveList.append(newLine);
                  gwcard = 0;
            }
            else if (card->getCardType() == "GA")
            {
                  // End1 and End2 contain GA parameters.
                  gacard = (GACard*)cardsList.at(i);
                  end1[0] = gacard->getArcRadius();
                  end1[1] = gacard->getFirstEndAngle();
                  end1[2] = gacard->getSecondEndAngle();
                  end2[0] = gacard->getWireRadius();

                  newLine = new Line("GA", end1, end2, gacard->getTagNumber(),gacard->getNumberOfSegments(), 0 );
                  primitiveList.append(newLine);
                  gacard = 0;
            }
            else if (card->getCardType() == "SP")
            {
                  ProcessSPCard(i);
            }
            else if (card->getCardType() == "FR")
            {
                  // We search for the first FR card
                  if(!foundFRCard)
                  {
                        frcard = (FRCard*)cardsList.at(i);
                        frequency = frcard->getFrequency();
                        frcard = 0;
                        foundFRCard = true;
                  }
                  /*
                        If we already found a FR card, we fill the others with the same
                        frequency of the first one, wich is just a side effect.
                        If we are re-calcuating, we set the above frequency, which should be
                        already NECContainer's frequency.
                  */
                  else
                  {
                        frcard = (FRCard*)cardsList.at(i);
                        frcard->setFrequency(frequency);
                        frcard = 0;
                  }
            }
/// FIXME We will have to re write this... Ask Gustavo if in doubt...
//          else if (card->getCardType() == "SM")
//          {
//                // It's a particular case of SP with ns=1 (rectangular shape)
//                element->SetField("SP");
//                element->SetParameter(1, 1);
//                element->SetParameter(0, 0);
//                ProcessSPCard(i);
//          }
//          else if (element->GetField()=="GE")
//          { // It's a particular case of SP with ns=1 (rectangular shape)
//                if(element->GetParameter( 0)!=0)
//                      groundPlane=true;
//          }
//          else if (element->GetField()=="EX")
//          { // It's a particular case of SP with ns=1 (rectangular shape)
//                if(element->GetParameter( 0)==0 or element->GetParameter( 0)==5)
//                {
//                      if(element->GetParameter( 1)!=0)
//                            radiatingElement = (int)element->GetParameter( 1);
//                      else
//                            radiatingElement = (int)element->GetParameter( 2);
//                }
//          }
      }
      ProcessPrimitive();
}


Generated by  Doxygen 1.6.0   Back to index