// -----------------------------------------------------------------------------
// CTestSDKHierarchicalLists::TestHLSCLSetTextCIL
// -----------------------------------------------------------------------------
TInt CTestSDKHierarchicalLists::TestHLSCLSetTextCIL( CStifItemParser& /*aItem*/ )
    {
    CTestControl* control = CTestControl::NewL();
    CleanupStack::PushL( control );
    STIF_ASSERT_NOT_NULL( control );
    
    CAknSingleColumnStyleTreeList* treeList = CAknSingleColumnStyleTreeList::NewLC( *control );
    STIF_ASSERT_NOT_NULL( treeList );
    
    _LIT( KFirstColumn, "FirstColumn" );
    TBuf<KLength> firstColumn( KFirstColumn );
    _LIT( KSecondColumn, "SecondColumn" );
    TUint32 flags = CAknSingleColumnStyleTreeList::EPersistent;
    TAknTreeItemID id = treeList->AddCoreDataRowL( KAknTreeIIDRoot, firstColumn, KSecondColumn, flags, ETrue );
    STIF_ASSERT_NOT_EQUALS( 0, id );
    
    _LIT( KFirstColumnSet, "Change" );
    TBuf<KLength> textSet( KFirstColumnSet );
    treeList->SetTextL( id, textSet, 0, ETrue );
    
    TBuf<KLength> firstColumnGet = treeList->Text( id, 0 );
    STIF_ASSERT_EQUALS( 0, firstColumnGet.Compare( textSet ) );
    
    CleanupStack::PopAndDestroy( treeList );
    CleanupStack::PopAndDestroy( control );
    
    return KErrNone;
    
    }
Example #2
0
//  AbacusRefine
//
//  ctgcns - from=0 to=-1 level=abAbacus_Smooth
//         - from=0 to=-1 level=abAbacus_Poly_X
//         - from=0 to=-1 level=abAbacus_Indel
//  utgcns - same
//
//  from,to are C-style.  Used to be INCLUSIVE, but never used anyway
//
int32
abMultiAlign::refine(abAbacus            *abacus,
                     abAbacusRefineLevel  level,
                     uint32               from,    // from and to are in ma's column coordinates
                     uint32               to) {

  if (length() < to)
    to = length();

  abColID sid = columnList[from];      // id of the starting column
  abColID eid = columnList[to - 1];    // id of the ending column

  assert(sid == firstColumn());
  assert(eid == lastColumn());

  abColumn *start_column = abacus->getColumn(sid);
  abColID   stab_bgn;

  uint32    score_reduction = 0;


  while (start_column->ident() != eid) {
    int32 window_width = IdentifyWindow(abacus, start_column, stab_bgn, level);

    // start_column stands as the candidate for first column in window
    // look for window start and stop

    if (window_width > 0) {

      //  If the first column, insert a gap column for maneuvering room
      if (start_column->prevID().isValid() == false) {
        abBeadID   firstbeadID = abacus->getBead(start_column->callID() )->downID();
        abBeadID   newbeadID   = abacus->appendGapBead(abacus->getBead(firstbeadID)->ident());

        fprintf(stderr, "Adding gapbead "F_U32" after "F_U32" to add abacus room for abutting left of multialignment\n",
                newbeadID.get(), firstbeadID.get());

        abacus->appendColumn(abacus->getBead(firstbeadID)->colIdx(), newbeadID);
      }

      //  if the window is too big, there's likely a polymorphism that won't respond well to abacus,
      //  so skip it.
      //
      //  BPW saw crashes with large window_width's (1333, 3252, 1858, 675, 855, 1563, 601, 1102).
      //  The longest window_width that worked was 573.  Previous versions used 100 here.  Not sure
      //  what it should be.
      //
      if (window_width < MAX_WINDOW_FOR_ABACUS_REFINE)
        score_reduction += refineWindow(abacus, start_column, stab_bgn);

      start_column = abacus->getColumn(stab_bgn);
    }

    start_column = abacus->getColumn(stab_bgn);
  }

  //  WITH quality=1 make_v_list=1, all the rest defaults
  abacus->refreshMultiAlign(ident(), true, true);

  return(score_reduction);
}