当前位置: 首页>>代码示例>>C++>>正文


C++ wb_object::first方法代码示例

本文整理汇总了C++中wb_object::first方法的典型用法代码示例。如果您正苦于以下问题:C++ wb_object::first方法的具体用法?C++ wb_object::first怎么用?C++ wb_object::first使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wb_object的用法示例。


在下文中一共展示了wb_object::first方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: process

static void process( wb_session& session, wb_object& o)
{
  pwr_sPlcNode plcnode;

  if ( o.cid() == pwr_cClass_csub) {
    printf ( "Object: %s\n", o.longName().c_str());

    wb_attribute a = session.attribute( o.oid(), "DevBody", "PlcNode");
    if ( !a) exit(0);

    a.value( &plcnode);

    printf( "subwindow:  %d, woid: %u,%u\n", plcnode.subwindow, 
	    plcnode.subwind_oid[0].vid, plcnode.subwind_oid[0].oix);

    wb_object c = o.first();
    if ( c && c.cid() == pwr_cClass_windowplc) {
      plcnode.subwind_oid[0].vid = c.oid().vid;
      plcnode.subwind_oid[0].oix = c.oid().oix;

      printf( "subwindow:  %d, woid: %u,%u\n", plcnode.subwindow, 
	      plcnode.subwind_oid[0].vid, plcnode.subwind_oid[0].oix);

      session.writeAttribute( a, &plcnode, sizeof(plcnode)); 
      if ( !a) cout << "** Write error" << endl;
    }
  }

  for ( wb_object c = o.first(); c.oddSts(); c = c.after()) {
    process( session, c);
  }
}
开发者ID:jordibrus,项目名称:proview,代码行数:32,代码来源:wb_upgrade.cpp

示例2: deleteObject

bool wb_session::deleteObject(wb_object o)
{
  if (isReadonly())
    throw wb_error_str("ReadOnlySession");

  if (!isLocal(o)) {
    m_sts = LDH__OTHERVOLUME;
    return false;
  }
  if (o.first()) {
    m_sts = LDH__HAS_CHILD;
    return false;
  }

  pwr_tStatus sts;
  wb_object parent = o.parent();
  sts = triggAnteUnadopt(parent, o);

  ldh_sEvent* ep = m_srep->eventStart(o.oid(), ldh_eEvent_ObjectDeleted);
  m_srep->eventOldFamily(ep, o);

  sts = triggPostUnadopt(parent, o);

  bool rsts = m_vrep->deleteObject(&m_sts, (wb_orep*)o);
  m_srep->update();
  m_srep->eventSend(ep);
  return rsts;
}
开发者ID:siamect,项目名称:proview,代码行数:28,代码来源:wb_session.cpp

示例3: CheckChildCid

static bool CheckChildCid( wb_object &o, pwr_tCid cid) 
{
  for ( wb_object child = o.first(); child; child = child.after()) {
    if ( child.cid() == cid) {
      return true;
    }
    if ( CheckChildCid( child, cid))
      return true;	 
  }
  return false;
}
开发者ID:jordibrus,项目名称:proview,代码行数:11,代码来源:wb_c_plcpgm.cpp

示例4: syntaxCheckObject

pwr_tStatus wb_volume::syntaxCheckObject(wb_object& o, int *errorcount, int *warningcount)
{
  pwr_tStatus sts, csts;
  wb_object first, after;
  wb_attribute a(o.sts(), o);
  
  sts = triggSyntaxCheck(a, errorcount, warningcount);
  if (EVEN(sts)) return sts;

  // Get any attribute objects
  wb_cdef cd = cdef(o);
  if ( !cd) return cd.sts();

  wb_bdef bdef = cd.bdef(pwr_eBix_rt);
  wb_adef adef;
  if ( bdef) {
    for (adef = bdef.adef(); adef; adef = adef.next()) {
      if ( !(adef.flags() & PWR_MASK_CLASS))
	continue;

      if ( adef.flags() & PWR_MASK_ARRAY) {
	for ( int i = 0; i < adef.nElement(); i++) {
	  wb_attribute a( adef.sts(), o, adef, i);
	  
	  csts = syntaxCheckAttr( a, errorcount, warningcount);
	  if ( EVEN(csts)) sts = csts;
	}
      }
      else {
	wb_attribute a( adef.sts(), o, adef);
	
	if ( adef.flags() & PWR_MASK_DISABLEATTR && a.disabled())
	  continue;

	csts = syntaxCheckAttr( a, errorcount, warningcount);
	if ( EVEN(csts)) sts = csts;
      }
    }
  }


  for ( wb_object c = o.first(); c; c = c.after()) {
    if ( c.cid() == pwr_eClass_LibHier)
      continue;
    csts = syntaxCheckObject(c, errorcount, warningcount);
    if ( EVEN(csts))
      sts = csts;
  }

  return sts;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:51,代码来源:wb_volume.cpp

示例5: printObject

//
// printObject
//
void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive)
{
  wb_object to = o;
  wb_object templ;
  cdh_uObjid	uid;
  unsigned int idx;
  wb_cdef cdef = v.cdef(o);
  if ( !cdef) {
    m_os << "! %WBDUMP-E-Error Failed to get object class" << endl;
    m_errCnt++;
    // return;
    cdef = v.cdef( pwr_eClass_ClassLost);
  }
  const char* cname = cdef.name();
  char *block;
  int size;

  if ( o.docBlock( &block, &size) && strcmp( block, "") != 0) {
    indent(0) << "!/**" << endl;
    indent(0) << "! ";
    for ( char *s = block; *s; s++) {
      if ( *s == '\n') {
	m_os << *s;
	indent(0) << "! ";
	continue;
      }
      m_os << *s;
    }
    m_os << endl;
    indent(0) << "!*/" << endl;
  }

  indent(1) << "Object " << o.name() << " " << cname;

  if (m_idxFlag) {
    switch (cdef.cid()) {
    case pwr_eClass_ClassDef:
      uid.pwr = o.oid();
      idx = uid.c.cix;
      break;
    case pwr_eClass_TypeDef:
      uid.pwr = o.oid();
      idx = uid.t.tix;
      break;
    case pwr_eClass_ObjBodyDef:
      uid.pwr = o.oid();
      idx = uid.c.bix;
      break;
    case pwr_eClass_Param:
    case pwr_eClass_Input:
    case pwr_eClass_Output:
    case pwr_eClass_Intern:
    case pwr_eClass_Buffer:
    case pwr_eClass_ObjXRef:
      uid.pwr = o.oid();
      idx = uid.c.aix;
      break;
    default:
      idx = (unsigned long) o.oix();
    }
    m_os << " " << idx;
  }
  if ( m_timeFlag) {
    // Get oh time
    char timestr[40];
    pwr_tTime ohtime = o.ohTime();
    time_AtoAscii( &ohtime, time_eFormat_DateAndTime, timestr, sizeof(timestr));

    m_os << " " << timestr;
  }
  m_os << endl;

  wb_object co = v.object(cdh_ClassIdToObjid(cdef.cid()));
  wb_name t("Template");
  
  templ = co.child(t);
  if (!templ) {
    m_errCnt++;
    m_os << "Template not found for class " << cdef.name() << endl;
    return;
  }

  if ( v.cid() == pwr_eClass_ClassVolume &&
       strcmp( o.name(), "Template") == 0)
    m_isTemplateObject = true;
  else
    m_isTemplateObject = false;
  
 
  printBody(v, o, templ, cdef, pwr_eBix_rt);
  printBody(v, o, templ, cdef, pwr_eBix_dev);

  if (recursive) {
    if ( !(m_noFoCodeFlag && isFoCodeObject( v, o))) {
      for (to = o.first(); to; to = to.after())
	printObject(v, to);
    }
//.........这里部分代码省略.........
开发者ID:Strongc,项目名称:proview,代码行数:101,代码来源:wb_print_wbl.cpp


注:本文中的wb_object::first方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。