1111import org .iottree .core .basic .ValUnit ;
1212import org .iottree .core .cxt .JsDef ;
1313import org .iottree .core .util .Convert ;
14+ import org .iottree .core .util .IdIId ;
1415import org .iottree .core .util .Lan ;
1516import org .iottree .core .util .xmldata .data_class ;
1617import org .iottree .core .util .xmldata .data_obj ;
@@ -99,10 +100,13 @@ protected void copyTreeWithNewSelf(IRoot root,UANode new_self, String ownerid,
99100 UATag nt = new UATag ();
100101 if (root_subnode_id )
101102 {
103+ IdIId iiid = null ;
102104 if (root !=null )
103- nt . id = root .getRootNextId ();
105+ iiid = root .getRootNextId ();
104106 else
105- nt .id = this .getNextIdByRoot ();
107+ iiid = this .getNextIdByRoot ();
108+
109+ nt .setIdIId (iiid );
106110 }
107111
108112 t .copyTreeWithNewSelf (root ,nt , ownerid , copy_id , root_subnode_id ,rf2new );
@@ -305,7 +309,7 @@ else if(!p_addr.canWrite())
305309 d = new UATag (name , title , desc , addr , vt , dec_digits ,mid_w_js );
306310 else
307311 d = new UATag (name , title , desc , addr , vt , dec_digits , canw , srate );
308- d .id = this .getNextIdByRoot ();
312+ d .setIdIId ( this .getNextIdByRoot () );
309313 tags .add (d );
310314 constructNodeTree ();
311315 }
@@ -469,7 +473,8 @@ public UATag addTagByCopy(UATag cp_tag,boolean b_chg_title,boolean b_chg_addr) t
469473 new_addr = n_addr .toString ("" ) ;
470474 }
471475 UATag newtag = new UATag (cp_tag , name ,newtt ,new_addr );
472- newtag .id = this .getNextIdByRoot ();
476+ //newtag.id = this.getNextIdByRoot();
477+ newtag .setIdIId (this .getNextIdByRoot ());
473478 tags .add (newtag );
474479 constructNodeTree ();
475480
@@ -527,7 +532,8 @@ UATag addOrUpdateTagSys(String tagid, boolean bmid, String name, String title, S
527532 d = new UATag ();
528533 d .setTagSys (name , title , desc , addr , vt , dec_digits , canw , srate );
529534 }
530- d .id = this .getNextIdByRoot ();
535+ //d.id = this.getNextIdByRoot();
536+ d .setIdIId (this .getNextIdByRoot ()) ;
531537 if (d .isSysTag ())
532538 sysTags .add (d );
533539 else
@@ -559,7 +565,8 @@ public UATag addTag(DevItem item) throws Exception
559565 throw new IllegalArgumentException ("tag with name=" + name + " existed" );
560566 }
561567 UATag d = new UATag (item );
562- d .id = this .getNextIdByRoot ();
568+ //d.id = this.getNextIdByRoot();
569+ d .setIdIId (this .getNextIdByRoot ());
563570 tags .add (d );
564571 constructNodeTree ();
565572 this .bDirty = true ;
@@ -585,7 +592,8 @@ public UATag addTag(String name,String title,String desc,UAVal.ValTP vt,boolean
585592 }
586593
587594 UATag d = new UATag (name ,title ,desc ,null ,vt ,0 ,false ,200 );
588- d .id = this .getNextIdByRoot ();
595+ //d.id = this.getNextIdByRoot();
596+ d .setIdIId (this .getNextIdByRoot ()) ;
589597 d .bCanWrite = canwrite ;
590598 tags .add (d );
591599 constructNodeTree ();
0 commit comments