Beispiel #1
0
static iOTrack _inst( iONode props ) {
  iOTrack     track = allocMem( sizeof( struct OTrack ) );
  iOTrackData data  = allocMem( sizeof( struct OTrackData ) );

  /* OBase operations */
  MemOp.basecpy( track, &TrackOp, 0, sizeof( struct OTrack ), data );

  data->props = props;
  NodeOp.removeAttrByName(data->props, "cmd");

  TraceOp.trc( name, TRCLEVEL_DEBUG, __LINE__, 9999, "inst for %s", _getId(track) );

  instCnt++;

  return track;
}
Beispiel #2
0
static iOFBack _inst( iONode props ) {
  iOFBack     fback = allocMem( sizeof( struct OFBack ) );
  iOFBackData data  = allocMem( sizeof( struct OFBackData ) );

  /* OBase operations */
  MemOp.basecpy( fback, &FBackOp, 0, sizeof( struct OFBack ), data );

  data->props = props;
  data->timer = -1;
  /* initially the state is off: */
  wFeedback.setstate( props, False );

  if( wCtrl.istimedsensors( wRocRail.getctrl( AppOp.getIni() ) ) ) {
    data->timedoff = wFeedback.gettimer( props );
  }

  data->listeners = ListOp.inst();

  data->addrKey = _createAddrKey(
    wFeedback.getbus( props ),
    wFeedback.getaddr( props ),
    wFeedback.getiid( props )
    );

  NodeOp.removeAttrByName(data->props, "cmd");
  wFeedback.setgpssid(data->props, 0);

  __initCutout(fback);

  TraceOp.trc( name, TRCLEVEL_DEBUG, __LINE__, 9999, "inst[%d] for %s, %s",
        instCnt,
        _getId(fback),
        data->addrKey
        );

  instCnt++;

  return fback;
}