Exemplo n.º 1
0
void MainApplication::setProject ( Project* const value )
{
    _Project = value;
    if(getCurrentMode() != NULL)
    {
        getCurrentMode()->reset();
    }
    if(_Project != NULL)
    {
        SLOG << "Set Project to " << ( getName(_Project) ? getName(_Project) : "UNNAMED_PROJECT" ) << std::endl;
    }
}
Exemplo n.º 2
0
void MainApplication::attachPlayer(void)
{
    createDefaultPlayerMode();

    if(getCurrentMode() != NULL && getCurrentMode() != getPlayerMode())
    {
        getCurrentMode()->stop();
        getCurrentMode()->dettachApplication();
    }

    getPlayerMode()->attachApplication();
    setCurrentMode(getPlayerMode());

    getCurrentMode()->start();
}
Exemplo n.º 3
0
void MainApplication::attachStartScreen(void)
{
    createDefaultStartScreenMode();

    if(getCurrentMode() != NULL && getCurrentMode() != getStartScreenMode())
    {
        getCurrentMode()->stop();
        getCurrentMode()->dettachApplication();
    }

    getStartScreenMode()->attachApplication();
    setCurrentMode(getStartScreenMode());

    getCurrentMode()->start();
}
Exemplo n.º 4
0
void updateGraphicsTest(struct gameboy * gameboy)
{
	//fill a frame buffer with some simple pixel data and see if it draws correctly
	setLCDStatus(gameboy);
	uint8_t previousMode = getCurrentMode(gameboy);
	requestAnyNewModeInterrupts(gameboy, previousMode);
	if (isLCDEnabled(gameboy)){
		gameboy->screen.scanlineCounter += gameboy->cpu.previousInstruction.cycles;
	}
	else {
		return;
	}
	
	if (gameboy->screen.scanlineCounter >= SCANLINE_CYCLE_TIME){
		gameboy->screen.currentScanline++;
		gameboy->screen.scanlineCounter = 0;
		if (gameboy->screen.currentScanline == Y){
			requestInterrupt(gameboy, int_vblank);
			//printf("start vblank\n");
		}
		else if (gameboy->screen.currentScanline > (Y + NO_OF_INVISIBLE_SCANLINES)){
			gameboy->screen.currentScanline = 0;
			//printf("resetting scanline\n");
		}
		else if (gameboy->screen.currentScanline < Y){
//			printf("drawing scanline %d\n", gameboy->screen.currentScanline);
			drawScanline(gameboy);
		}
		else {
			//printf("In vblank\n");
		}
	}
	
}
Exemplo n.º 5
0
TEST_F(AdfTest, simple_buffer) {
    uint32_t w = 0, h = 0;
    ASSERT_NO_FATAL_FAILURE(getCurrentMode(w, h));

    uint32_t format = 0;
    char format_str[ADF_FORMAT_STR_SIZE];
    ASSERT_NO_FATAL_FAILURE(get8888Format(format, format_str));

    uint32_t offset;
    uint32_t pitch;
    int buf_fd = adf_interface_simple_buffer_alloc(intf, w, h, format, &offset,
            &pitch);
    ASSERT_GE(buf_fd, 0) << "allocating " << w << "x" << h << " " <<
            format_str << " buffer failed: " << strerror(-buf_fd);
    EXPECT_GE(pitch, w * 4);

    void *mapped = mmap(NULL, pitch * h, PROT_WRITE, MAP_SHARED, buf_fd,
            offset);
    ASSERT_NE(mapped, MAP_FAILED) << "mapping " << w << "x" << h << " " <<
            format_str << " buffer failed: " << strerror(-errno);
    drawCheckerboard(mapped, w, h, pitch);
    munmap(mapped, pitch * h);

    ASSERT_NO_FATAL_FAILURE(attach());
    ASSERT_NO_FATAL_FAILURE(blank(DRM_MODE_DPMS_ON));

    int release_fence = adf_interface_simple_post(intf, eng_id, w, h, format,
            buf_fd, offset, pitch, -1);
    close(buf_fd);
    ASSERT_GE(release_fence, 0) << "posting " << w << "x" << h << " " <<
            format_str << " buffer failed: " << strerror(-release_fence);
    close(release_fence);
}
Exemplo n.º 6
0
void ElectronKernel::loop() {

  checkModeChange();

  while(lastMode!=mode) {
    callChangeModeListeners();
    lastMode=mode;
    checkModeChange();
    modes[mode].callSetup();
    checkModeChange();
  }
  lastMode=mode;
  for(int x=0;x<getCurrentMode().numberOfTasks && lastMode==mode;x++) {
    getCurrentMode().tasks[x].callTask();
    checkModeChange();
  }  
}
Exemplo n.º 7
0
static void requestAnyNewModeInterrupts(struct gameboy * gameboy, uint8_t previousMode)
{
	bool enabled = gameboy->screen.currentLCDInterruptEnabled;
	uint8_t currentMode = getCurrentMode(gameboy);
	if (enabled && (currentMode != previousMode)){
		requestInterrupt(gameboy, lcdStat);
	}
	
}
Exemplo n.º 8
0
void updateGraphics(struct gameboy * gameboy)
{
	int cycles = gameboy->cpu.previousInstruction.cycles;
	uint8_t previousMode = getCurrentMode(gameboy);
	setLCDStatus(gameboy);
	requestAnyNewModeInterrupts(gameboy, previousMode);
	doCoincidenceFlag(gameboy);
	if (isLCDEnabled(gameboy)){
		gameboy->screen.scanlineCounter += cycles;
		doScanline(gameboy);
	}
}
Exemplo n.º 9
0
void EXTI9_5_IRQHandler(void) {
	//检查指定的EXTI0线路触发请求发生与否
	if (EXTI_GetITStatus(EXTI_Line8) != RESET) {
#ifdef DEBUG
		printf("EXTI9_5_IRQHandler\r\n");
#endif
		if (getCurrentMode() == TX_MODE) {
			CC1101ClrTXBuff();
#ifdef DEBUG
			printf("send over\r\n");
#endif
		} else {
			RecPacket();
		}
	}
	EXTI_ClearITPendingBit(EXTI_Line8);  //清除EXTI0线路挂起位
}
Exemplo n.º 10
0
TEST_F(AdfTest, simple_buffer_alloc) {
    uint32_t w = 0, h = 0;
    ASSERT_NO_FATAL_FAILURE(getCurrentMode(w, h));

    uint32_t format;
    char format_str[ADF_FORMAT_STR_SIZE];
    ASSERT_NO_FATAL_FAILURE(get8888Format(format, format_str));

    uint32_t offset;
    uint32_t pitch;
    int buf_fd = adf_interface_simple_buffer_alloc(intf, w, h, format, &offset,
            &pitch);
    EXPECT_GE(buf_fd, 0) << "allocating " << w << "x" << h << " " <<
            format_str << " buffer failed: " << strerror(-buf_fd);
    EXPECT_GE(pitch, w * 4);
    close(buf_fd);

    buf_fd = adf_interface_simple_buffer_alloc(intf, w, h, 0xDEADBEEF, &offset,
            &pitch);
    /* n.b.: ADF only allows simple buffers with built-in RGB formats,
       so this should fail even if a driver supports custom format 0xDEADBEEF */
    EXPECT_EQ(-EINVAL, buf_fd) <<
            "allocating buffer with bogus format should have failed";
}
Exemplo n.º 11
0
void
FDD1516EContentHandler::endElement(const char* uri, const char* name, const char* qName)
{
  if (strcmp(name, "name") == 0) {
    switch (getCurrentMode()) {
    case ObjectClassNameMode:
      if (!_fomStringModuleBuilder.getCurrentObjectClass().getName().empty())
        throw ErrorReadingFDD("Duplicate name tag for object class \"" + _characterData + "\"!");
      _fomStringModuleBuilder.getCurrentObjectClass().getName().push_back(_characterData);
      break;
    case ObjectClassAttributeNameMode:
      if (!_fomStringModuleBuilder.getCurrentObjectClassAttribute().getName().empty())
        throw ErrorReadingFDD("Duplicate name tag for object class attribute \"" +
                              _fomStringModuleBuilder.getCurrentObjectClassAttribute().getName() + "\"!");
      _fomStringModuleBuilder.getCurrentObjectClassAttribute().setName(_characterData);
      break;
    case InteractionClassNameMode:
      if (!_fomStringModuleBuilder.getCurrentInteractionClass().getName().empty())
        throw ErrorReadingFDD("Duplicate name tag for interaction class \"" + _characterData + "\"!");
      _fomStringModuleBuilder.getCurrentInteractionClass().getName().push_back(_characterData);
      break;
    case InteractionClassParameterNameMode:
      if (!_fomStringModuleBuilder.getCurrentInteractionClassParameter().getName().empty())
        throw ErrorReadingFDD("Duplicate name tag for interaction class parameter \"" +
                              _fomStringModuleBuilder.getCurrentInteractionClassParameter().getName() + "\"!");
      _fomStringModuleBuilder.getCurrentInteractionClassParameter().setName(_characterData);
      break;
    case DimensionsDimensionNameMode:
      if (!_fomStringModuleBuilder.getCurrentDimension().getName().empty())
        throw ErrorReadingFDD("Duplicate name tag for dimension \"" +
                              _fomStringModuleBuilder.getCurrentDimension().getName() + "\"!");
      _fomStringModuleBuilder.getCurrentDimension().setName(_characterData);
      break;
    case TransportationNameMode:
      if (!_fomStringModuleBuilder.getCurrentTransportationType().getName().empty())
        throw ErrorReadingFDD("Duplicate name tag for transportation \"" +
                              _fomStringModuleBuilder.getCurrentTransportationType().getName() + "\"!");
      _fomStringModuleBuilder.getCurrentTransportationType().setName(_characterData);
      break;
    case UpdateRateNameMode:
      if (!_fomStringModuleBuilder.getCurrentUpdateRate().getName().empty())
        throw ErrorReadingFDD("Duplicate name tag for updateRate \"" +
                              _fomStringModuleBuilder.getCurrentUpdateRate().getName() + "\"!");
      _fomStringModuleBuilder.getCurrentUpdateRate().setName(_characterData);
      break;
    default:
      break;
    }

  } else if (strcmp(name, "transportation") == 0) {
    switch (getCurrentMode()) {
    case ObjectClassAttributeTransportationMode:
      _fomStringModuleBuilder.getCurrentObjectClassAttribute().setTransportationType(_characterData);
      break;
    case InteractionClassTransportationMode:
      _fomStringModuleBuilder.getCurrentInteractionClass().setTransportationType(_characterData);
      break;
    case TransportationNameMode:
      if (_fomStringModuleBuilder.getCurrentTransportationType().getName().empty())
        throw ErrorReadingFDD("No name given for transportation!");
      break;
    default:
      break;
    }

  } else if (strcmp(name, "rate") == 0) {
    std::stringstream ss(_characterData);
    double rate = 0;
    ss >> rate;
    _fomStringModuleBuilder.getCurrentUpdateRate().setRate(rate);

  } else if (strcmp(name, "order") == 0) {
Exemplo n.º 12
0
void
FDD1516EContentHandler::startElement(const char* uri, const char* name,
                                     const char* qName, const XML::Attributes* atts)
{
  /// Tags that can happen at multiple places
  if (strcmp(name, "name") == 0) {
    switch (getCurrentMode()) {
    case ObjectClassMode:
      _modeStack.push_back(ObjectClassNameMode);
      break;
    case ObjectClassAttributeMode:
      _modeStack.push_back(ObjectClassAttributeNameMode);
      break;
    case InteractionClassMode:
      _modeStack.push_back(InteractionClassNameMode);
      break;
    case InteractionClassParameterMode:
      _modeStack.push_back(InteractionClassParameterNameMode);
      break;
    case DimensionsDimensionMode:
      _modeStack.push_back(DimensionsDimensionNameMode);
      break;
    case TransportationMode:
      _modeStack.push_back(TransportationNameMode);
      break;
    case UpdateRateMode:
      _modeStack.push_back(UpdateRateNameMode);
      break;
    default:
      // throw ErrorReadingFDD("unexpected name tag!");
      _modeStack.push_back(UnknownMode);
      break;
    }

  } else if (strcmp(name, "sharing") == 0) {
    switch (getCurrentMode()) {
    case UnknownMode:
      _modeStack.push_back(UnknownMode);
      break;
    case ObjectClassMode:
      _modeStack.push_back(ObjectClassSharingMode);
      break;
    case ObjectClassAttributeMode:
      _modeStack.push_back(ObjectClassAttributeSharingMode);
      break;
    case InteractionClassMode:
      _modeStack.push_back(InteractionClassSharingMode);
      break;
    default:
      // throw ErrorReadingFDD("unexpected sharing tag!");
      _modeStack.push_back(UnknownMode);
      break;
    }

  } else if (strcmp(name, "semantics") == 0) {
    switch (getCurrentMode()) {
    case UnknownMode:
      _modeStack.push_back(UnknownMode);
      break;
    case ObjectClassMode:
      _modeStack.push_back(ObjectClassSemanticsMode);
      break;
    case ObjectClassAttributeMode:
      _modeStack.push_back(ObjectClassAttributeSemanticsMode);
      break;
    case InteractionClassMode:
      _modeStack.push_back(InteractionClassSemanticsMode);
      break;
    case InteractionClassParameterMode:
      _modeStack.push_back(InteractionClassParameterSemanticsMode);
      break;
    case TransportationMode:
      _modeStack.push_back(TransportationSemanticsMode);
      break;
    default:
      // throw ErrorReadingFDD("unexpected semantics tag!");
      _modeStack.push_back(UnknownMode);
      break;
    }

  } else if (strcmp(name, "dataType") == 0) {
    switch (getCurrentMode()) {
    case ObjectClassAttributeMode:
      _modeStack.push_back(ObjectClassAttributeDataTypeMode);
      break;
    case InteractionClassParameterMode:
      _modeStack.push_back(InteractionClassParameterDataTypeMode);
      break;
    case DimensionsDimensionMode:
      _modeStack.push_back(DimensionsDimensionDataTypeMode);
      break;
    default:
      // throw ErrorReadingFDD("unexpected dataType tag!");
      _modeStack.push_back(UnknownMode);
      break;
    }

  } else if (strcmp(name, "transportation") == 0) {
    switch (getCurrentMode()) {
    case ObjectClassAttributeMode:
      _modeStack.push_back(ObjectClassAttributeTransportationMode);
      break;
    case InteractionClassMode:
      _modeStack.push_back(InteractionClassTransportationMode);
      break;
    case TransportationsMode:
      _modeStack.push_back(TransportationMode);
      _fomStringModuleBuilder.addTransportationType();
      break;
    default:
      // throw ErrorReadingFDD("unexpected transportation tag!");
      _modeStack.push_back(UnknownMode);
      break;
    }

  } else if (strcmp(name, "order") == 0) {
    switch (getCurrentMode()) {
    case ObjectClassAttributeMode:
      _modeStack.push_back(ObjectClassAttributeOrderMode);
      break;
    case InteractionClassMode:
      _modeStack.push_back(InteractionClassOrderMode);
      break;
    default:
      // throw ErrorReadingFDD("unexpected order tag!");
      _modeStack.push_back(UnknownMode);
      break;
    }

  } else if (strcmp(name, "dimensions") == 0) {
    switch (getCurrentMode()) {
    case ObjectClassAttributeMode:
      _modeStack.push_back(ObjectClassAttributeDimensionsMode);
      break;
    case InteractionClassMode:
      _modeStack.push_back(InteractionClassDimensionsMode);
      break;
    case ObjectModelMode:
      _modeStack.push_back(DimensionsMode);
      break;
    default:
      // throw ErrorReadingFDD("unexpected dimensions tag!");
      _modeStack.push_back(UnknownMode);
      break;
    }

  } else if (strcmp(name, "dimension") == 0) {
    switch (getCurrentMode()) {
    case ObjectClassAttributeDimensionsMode:
      _modeStack.push_back(ObjectClassAttributeDimensionsDimensionMode);
      break;
    case InteractionClassDimensionsMode:
      _modeStack.push_back(InteractionClassDimensionsDimensionMode);
      break;
    case DimensionsMode:
      _modeStack.push_back(DimensionsDimensionMode);
      _fomStringModuleBuilder.addDimension();
      break;
    default:
      // throw ErrorReadingFDD("unexpected dimension tag!");
      _modeStack.push_back(UnknownMode);
      break;
    }


    /// Top level tag
  } else if (strcmp(name, "objectModel") == 0) {
    _modeStack.push_back(ObjectModelMode);


    /// First level tags
  } else if (strcmp(name, "modelIdentification") == 0) {
    _modeStack.push_back(ModelIdentificationMode);

  } else if (strcmp(name, "objects") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("objects tag outside objectModel!");
    _modeStack.push_back(ObjectsMode);

  } else if (strcmp(name, "interactions") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("interactions tag outside objectModel!");
    _modeStack.push_back(InteractionsMode);

  } else if (strcmp(name, "time") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("time tag outside objectModel!");
    _modeStack.push_back(TimeMode);

  } else if (strcmp(name, "tags") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("tags tag outside objectModel!");
    _modeStack.push_back(TagsMode);

  } else if (strcmp(name, "synchronizations") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("synchronizations tag outside objectModel!");
    _modeStack.push_back(SynchronizationsMode);

  } else if (strcmp(name, "transportations") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("transportations tag outside objectModel!");
    _modeStack.push_back(TransportationsMode);

  } else if (strcmp(name, "switches") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("switches tag outside objectModel!");
    _modeStack.push_back(SwitchesMode);

  } else if (strcmp(name, "dataTypes") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("dataTypes tag outside objectModel!");
    _modeStack.push_back(DataTypesMode);

  } else if (strcmp(name, "notes") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("notes tag outside objectModel!");
    _modeStack.push_back(NotesMode);


    /// updateRates
  } else if (strcmp(name, "updateRates") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("updateRates tag outside objectModel!");
    _modeStack.push_back(UpdateRatesMode);

  } else if (strcmp(name, "updateRate") == 0) {
    if (getCurrentMode() != UpdateRatesMode)
      throw ErrorReadingFDD("updateRates tag outside updateRates!");
    _modeStack.push_back(UpdateRateMode);
    _fomStringModuleBuilder.addUpdateRate();

  } else if (strcmp(name, "rate") == 0) {
    if (getCurrentMode() != UpdateRateMode)
      throw ErrorReadingFDD("rate tag outside updateRate!");
    _modeStack.push_back(UpdateRateRateMode);


    /// objectClass hierarchies
  } else if (strcmp(name, "objectClass") == 0) {
    if (getCurrentMode() != ObjectsMode && getCurrentMode() != ObjectClassMode)
      throw ErrorReadingFDD("objectClass tag outside objectClass or objects!");
    _modeStack.push_back(ObjectClassMode);

    _fomStringModuleBuilder.pushObjectClass();

  } else if (strcmp(name, "attribute") == 0) {
    if (getCurrentMode() != ObjectClassMode)
      throw ErrorReadingFDD("attribute tag outside objectClass!");
    _modeStack.push_back(ObjectClassAttributeMode);

    _fomStringModuleBuilder.addAttribute();

  } else if (strcmp(name, "updateType") == 0) {
    if (getCurrentMode() != ObjectClassAttributeMode)
      throw ErrorReadingFDD("updateType tag outside attribute!");
    _modeStack.push_back(ObjectClassAttributeUpdateTypeMode);

  } else if (strcmp(name, "updateCondition") == 0) {
    if (getCurrentMode() != ObjectClassAttributeMode)
      throw ErrorReadingFDD("updateCondition tag outside attribute!");
    _modeStack.push_back(ObjectClassAttributeUpdateConditionMode);

  } else if (strcmp(name, "ownership") == 0) {
    if (getCurrentMode() != ObjectClassAttributeMode)
      throw ErrorReadingFDD("ownership tag outside attribute!");
    _modeStack.push_back(ObjectClassAttributeOwnershipMode);


    /// interactionClass hierarchies
  } else if (strcmp(name, "interactionClass") == 0) {
    if (getCurrentMode() != InteractionsMode && getCurrentMode() != InteractionClassMode)
      throw ErrorReadingFDD("interactionClass tag outside interactionClass or interactions!");
    _modeStack.push_back(InteractionClassMode);

    _fomStringModuleBuilder.pushInteractionClass();

  } else if (strcmp(name, "parameter") == 0) {
    if (getCurrentMode() != InteractionClassMode)
      throw ErrorReadingFDD("parameter tag outside interactionClass!");
    _modeStack.push_back(InteractionClassParameterMode);

    _fomStringModuleBuilder.addParameter();


    /// dimensions
  } else if (strcmp(name, "upperBound") == 0) {
    if (getCurrentMode() != DimensionsDimensionMode)
      throw ErrorReadingFDD("upperBound tag outside dimension!");
    _modeStack.push_back(DimensionsDimensionUpperBoundMode);

  } else if (strcmp(name, "normalization") == 0) {
    if (getCurrentMode() != DimensionsDimensionMode)
      throw ErrorReadingFDD("normalization tag outside dimension!");
    _modeStack.push_back(DimensionsDimensionNormalizationMode);

  } else if (strcmp(name, "value") == 0) {
    if (getCurrentMode() != DimensionsDimensionMode && getCurrentMode() != UnknownMode)
      throw ErrorReadingFDD("value tag outside dimension!");
    _modeStack.push_back(DimensionsDimensionValueMode);


    /// Transportations
  } else if (strcmp(name, "reliable") == 0) {
    if (getCurrentMode() != TransportationMode)
      throw ErrorReadingFDD("reliable tag outside transportation!");
    _modeStack.push_back(TransportationReliableMode);

  } else {
    _modeStack.push_back(UnknownMode);
  }

  _characterData.clear();
}
Exemplo n.º 13
0
void
FDD1516ContentHandler::startElement(const char* uri, const char* name,
                                    const char* qName, const XML::Attributes* atts)
{
  if (strcmp(name, "attribute") == 0) {
    if (getCurrentMode() != ObjectClassMode)
      throw ErrorReadingFDD("attribute tag outside objectClass!");
    _modeStack.push_back(AttributeMode);

    _fomStringModuleBuilder.addAttribute();

    std::string name = trim(atts->getValue("name"));
    _fomStringModuleBuilder.getCurrentObjectClassAttribute().setName(name);
    std::string order = trim(atts->getValue("order"));
    _fomStringModuleBuilder.getCurrentObjectClassAttribute().setOrderType(order);
    std::string transportation = trim(atts->getValue("transportation"));
    _fomStringModuleBuilder.getCurrentObjectClassAttribute().setTransportationType(transportation);

    std::vector<std::string> dimensionList = split(atts->getValue("dimensions"), ", \t\n");
    for (std::vector<std::string>::const_iterator i = dimensionList.begin(); i != dimensionList.end(); ++i) {
      std::string trimmed = trim(*i);
      if (trimmed.empty())
        continue;
      if (trimmed == "NA")
        continue;
      _fomStringModuleBuilder.addAttributeDimension(trimmed);
    }

  } else if (strcmp(name, "objectClass") == 0) {
    if (getCurrentMode() != ObjectsMode && getCurrentMode() != ObjectClassMode)
      throw ErrorReadingFDD("objectClass tag outside objectClass or objects!");
    _modeStack.push_back(ObjectClassMode);

    _fomStringModuleBuilder.pushObjectClass();

    std::string name = classNamePart(trim(atts->getValue("name")));
    _fomStringModuleBuilder.getCurrentObjectClass().getName().push_back(name);

  } else if (strcmp(name, "objects") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("objects tag outside objectModel!");
    _modeStack.push_back(ObjectsMode);

  } else if (strcmp(name, "parameter") == 0) {
    if (getCurrentMode() != InteractionClassMode)
      throw ErrorReadingFDD("parameter tag outside interactionClass!");
    _modeStack.push_back(ParameterMode);

    _fomStringModuleBuilder.addParameter();

    std::string name = trim(atts->getValue("name"));
    _fomStringModuleBuilder.getCurrentInteractionClassParameter().setName(name);

  } else if (strcmp(name, "interactionClass") == 0) {
    if (getCurrentMode() != InteractionsMode && getCurrentMode() != InteractionClassMode)
      throw ErrorReadingFDD("interactionClass tag outside interactions or interactionClass!");
    _modeStack.push_back(InteractionClassMode);

    _fomStringModuleBuilder.pushInteractionClass();

    std::string name = classNamePart(trim(atts->getValue("name")));
    _fomStringModuleBuilder.getCurrentInteractionClass().getName().push_back(name);
    std::string order = trim(atts->getValue("order"));
    _fomStringModuleBuilder.getCurrentInteractionClass().setOrderType(order);
    std::string transportation = trim(atts->getValue("transportation"));
    _fomStringModuleBuilder.getCurrentInteractionClass().setTransportationType(transportation);

    std::vector<std::string> dimensionList = split(atts->getValue("dimensions"),  ", \t\n");
    for (std::vector<std::string>::const_iterator i = dimensionList.begin(); i != dimensionList.end(); ++i) {
      std::string trimmed = trim(*i);
      if (trimmed.empty())
        continue;
      if (trimmed == "NA")
        continue;
      _fomStringModuleBuilder.addInteractionDimension(trimmed);
    }

  } else if (strcmp(name, "interactions") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("interactions tag outside objectModel!");
    _modeStack.push_back(InteractionsMode);

  } else if (strcmp(name, "dimensions") == 0) {
    if (getCurrentMode() != ObjectModelMode)
      throw ErrorReadingFDD("dimensions tag outside objectModel!");
    _modeStack.push_back(DimensionsMode);

  } else if (strcmp(name, "dimension") == 0) {
    if (getCurrentMode() != DimensionsMode)
      throw ErrorReadingFDD("dimension tag outside dimensions!");
    _modeStack.push_back(DimensionMode);

    _fomStringModuleBuilder.addDimension();

    std::string name = trim(atts->getValue("name"));
    _fomStringModuleBuilder.getCurrentDimension().setName(name);

    std::stringstream ss(atts->getValue("upperBound"));
    Unsigned upperBound = 0;
    ss >> upperBound;
    _fomStringModuleBuilder.getCurrentDimension().setUpperBound(upperBound);

  } else if (strcmp(name, "transportation") == 0) {