Logo Search packages:      
Sourcecode: ktechlab version File versions

int MicroSettings::portState ( const QString &  port  ) 

Returns the initial port state (on/off) for the given port. Each pin state occupies one bit of the returned integer.

Definition at line 137 of file microsettings.cpp.

References microInfo().

Referenced by FlowCode::generateMicrobe().

{
      if ( microInfo()->package()->portNames().findIndex(port) == -1 ) return -1;
      
      int pinPower = 1;
      int num = 0;
      
      const PinSettingsList::iterator pinListEnd = m_pinSettingsList.end();
      for ( PinSettingsList::iterator it = m_pinSettingsList.begin(); it != pinListEnd; ++it )
      {
            if ( (*it)->port() == port )
            {
                  if ( (*it)->state() == PinSettings::ps_on ) num += pinPower;
//                cout << "(*it)->state()="<<(*it)->state()<<endl;
                  pinPower *= 2;
            }
      }
      
      return num;
}


Generated by  Doxygen 1.6.0   Back to index