Subversion Repositories DevTools

Rev

Rev 2267 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2267 Rev 2269
Line 455... Line 455...
455
					if ( discriminant.length() )
455
					if ( discriminant.length() )
456
					{
456
					{
457
						/**
457
						/**
458
						 *	We have a discriminant, so we evaluate it to form
458
						 *	We have a discriminant, so we evaluate it to form
459
						 *	our name,
459
						 *	our name,
-
 
460
                                                         *     With a special cases for auto udsn, ssn, trip and psn
460
						 */
461
						 */
-
 
462
                         
-
 
463
                        if (name == "UDSN")
-
 
464
                        {
-
 
465
                            fullName = "UDSN["+evaluationContext.getDeviceId()+"]";
-
 
466
                        }
-
 
467
                        else if (name == "AUTOSSN")
-
 
468
                        {
-
 
469
                            fullName = "AUTOSSN["+evaluationContext.getDeviceId()+"]";
-
 
470
                        }
-
 
471
                        else if (name == "AUTOTRIP")
-
 
472
                        {
-
 
473
                            fullName = "AUTOTRIP["+evaluationContext.getDeviceId()+"]";
-
 
474
                        }                         
-
 
475
                        else if (name == "AUTOPSN")
-
 
476
                        {
-
 
477
                            fullName = "AUTOPSN["+evaluationContext.getCsn()+"]";
-
 
478
                        } 
-
 
479
                        else  
-
 
480
                        {
461
						FieldExpression subexpression( discriminant );
481
						   FieldExpression subexpression( discriminant );
462
 
482
 
463
						std::string discriminantValue;
483
						   std::string discriminantValue;
464
						if ( subexpression.evaluate( discriminantValue, true, evaluationContext, path, postponed ) )
484
						   if ( subexpression.evaluate( discriminantValue, true, evaluationContext, path, postponed ) )
465
						{
485
						   {
466
							AnsiString full;
486
						       AnsiString full;
467
							full.sprintf( "%s[%s]", name.c_str(), discriminantValue.c_str() );
487
							   full.sprintf( "%s[%s]", name.c_str(), discriminantValue.c_str() );
468
							fullName = full.c_str();
488
							   fullName = full.c_str();
469
						}
489
						   }
-
 
490
                        }
470
					}
491
					}
471
					else
492
					else
472
					{
493
					{
473
						fullName = name;
494
						fullName = name;
474
					}
495
					}
Line 478... Line 499...
478
							fullName,
499
							fullName,
479
							persisted,
500
							persisted,
480
							atoi( first.c_str() ) );
501
							atoi( first.c_str() ) );
481
                    
502
                    
482
                    // don't increment on very first use of a new sequence  
503
                    // don't increment on very first use of a new sequence  
483
                    if(!sequence.isDirty() || sequence.isUpdate())
504
                    if(sequence.isDirty() || sequence.isUpdate())
484
                    {                    
505
                    {                    
485
    					sequence.incrementValue(
506
    					sequence.incrementValue(
486
    						atoi( first.c_str() ),
507
    						atoi( first.c_str() ),
487
    						atoi( last.c_str() ),
508
    						atoi( last.c_str() ),
488
    						atoi( increment.c_str() ) );
509
    						atoi( increment.c_str() ) );
Line 523... Line 544...
523
					{
544
					{
524
						/**
545
						/**
525
						 *	We have a discriminant, so we evaluate it to form
546
						 *	We have a discriminant, so we evaluate it to form
526
						 *	our name,
547
						 *	our name,
527
						 */
548
						 */
-
 
549
                        if (name == "SSN")
-
 
550
                        {
-
 
551
                            fullName = "SSN["+evaluationContext.getDeviceId()+"]";
-
 
552
                        }
-
 
553
                        else if (name == "TRIP")
-
 
554
                        {
-
 
555
                            fullName = "TRIP["+evaluationContext.getDeviceId()+"]";
-
 
556
                        } 
-
 
557
                        else if (name == "AUTOPSN")
-
 
558
                        {
-
 
559
                            fullName = "AUTOPSN["+evaluationContext.getCsn()+"]";
-
 
560
                        }                         
-
 
561
                        else  
-
 
562
                        {
528
						FieldExpression subexpression( discriminant );
563
						   FieldExpression subexpression( discriminant );
529
 
564
 
530
						std::string discriminantValue;
565
						   std::string discriminantValue;
531
						if ( subexpression.evaluate( discriminantValue, true, evaluationContext, path, postponed ) )
566
						   if ( subexpression.evaluate( discriminantValue, true, evaluationContext, path, postponed ) )
532
						{
567
						   {
533
							AnsiString full;
568
						       AnsiString full;
534
							full.sprintf( "%s[%s]", name.c_str(), discriminantValue.c_str() );
569
							   full.sprintf( "%s[%s]", name.c_str(), discriminantValue.c_str() );
535
							fullName = full.c_str();
570
							   fullName = full.c_str();
536
						}
571
						   }
-
 
572
                        }                         
537
					}
573
					}
538
					else
574
					else
539
					{
575
					{
540
						fullName = name;
576
						fullName = name;
541
					}
577
					}