blob: 4a023ad54f9a121b9924819ac156f88cdad38ba3 [file] [log] [blame]
/*************************************************************************
* Copyright (c) 2018 TU Wien/ACIN
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Martin Melik-Merkumians - adds intial implememtation
*************************************************************************/
#include "IL.h"
#ifdef FORTE_ENABLE_GENERATED_SOURCE_CPP
#include "IL_gen.cpp"
#endif
DEFINE_FIRMWARE_FB(FORTE_IL, g_nStringIdIL)
const CStringDictionary::TStringId FORTE_IL::scm_anDataInputNames[] = {g_nStringIdQI, g_nStringIdPARAMS};
const CStringDictionary::TStringId FORTE_IL::scm_anDataInputTypeIds[] = {g_nStringIdBOOL, g_nStringIdSTRING};
const CStringDictionary::TStringId FORTE_IL::scm_anDataOutputNames[] = {g_nStringIdQO, g_nStringIdSTATUS, g_nStringIdIN};
const CStringDictionary::TStringId FORTE_IL::scm_anDataOutputTypeIds[] = {g_nStringIdBOOL, g_nStringIdSTRING, g_nStringIdLWORD};
const TForteInt16 FORTE_IL::scm_anEIWithIndexes[] = {0, 3};
const TDataIOID FORTE_IL::scm_anEIWith[] = {0, 1, 255, 0, 255};
const CStringDictionary::TStringId FORTE_IL::scm_anEventInputNames[] = {g_nStringIdINIT, g_nStringIdREQ};
const TDataIOID FORTE_IL::scm_anEOWith[] = {0, 1, 255, 0, 1, 2, 255};
const TForteInt16 FORTE_IL::scm_anEOWithIndexes[] = {0, 3, -1};
const CStringDictionary::TStringId FORTE_IL::scm_anEventOutputNames[] = {g_nStringIdINITO, g_nStringIdCNF};
const SFBInterfaceSpec FORTE_IL::scm_stFBInterfaceSpec = {
2, scm_anEventInputNames, scm_anEIWith, scm_anEIWithIndexes,
2, scm_anEventOutputNames, scm_anEOWith, scm_anEOWithIndexes, 2, scm_anDataInputNames, scm_anDataInputTypeIds,
3, scm_anDataOutputNames, scm_anDataOutputTypeIds,
0, 0
};
void FORTE_IL::executeEvent(int pa_nEIID){
QO() = QI();
switch (pa_nEIID){
case cg_nExternalEventID:
sendOutputEvent (scm_nEventINDID);
break;
case scm_nEventINITID:
if(true == QI()){
QO() = CProcessInterface::initialise(true); //initialise as input
}
else{
QO() = CProcessInterface::deinitialise();
}
sendOutputEvent(scm_nEventINITOID);
break;
case scm_nEventREQID:
if(true == QI()){
QO() = CProcessInterface::readLWord();
}
sendOutputEvent(scm_nEventCNFID);
break;
}
}