Subversion Repositories SmartDukaan

Rev

Rev 1226 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

if vars().has_key('expSlide'):
    print "expSlide=" + `expSlide`


# Pick 2G and 3G Feature objects
threeGFeature = None
v3Ghours = None

expSlide = expSlide.getExpandedChildrenSlides().get(0)
print expSlide.getSlideDefinitionID()
expSlide =  expSlide.getExpandedChildrenSlides().get(0)
print expSlide.getSlideDefinitionID()

expandedFeatures = expSlide.getExpandedFeatures()

for expandedFeature in expandedFeatures:
    label = expandedFeature.getFeatureDefinition().getLabel()
    if label == "2G":
        twoGFeature = expandedFeature
    elif label == "3G":
        threeGFeature = expandedFeature 
        
twoGBullets = twoGFeature.getExpandedBullets()

# Is a single-value field
twoGBullet = twoGBullets[0]
v2G = twoGBullet.getValue()
print "v2G=" + `v2G`
v2Gparts = v2G.split()

# Take only hours
v2Ghours = float(v2Gparts[0])
print "v2Ghours=" + `v2Ghours`

if threeGFeature is not None:        
    threeGBullets = threeGFeature.getExpandedBullets()

    # Is a single-value field
    threeGBullet = threeGBullets[0]
    v3G = threeGBullet.getValue()
    print "v3G=" + `v3G`
    v3Gparts = v3G.split()

    # Take only hours
    v3Ghours = float(v3Gparts[0])
    print "v3Ghours=" + `v3Ghours`

# Rough values
# 2G High > 10, Medium > 5 else Low
# 3G High > 5, Medium > 3 else Low

# Overall: Highest of both e.g. if 2G:Low and 3G:Medium, Overall:Medium

# 1 - Low
# 2 - Medium
# 3 - High

# 2G logic
if v2Ghours >= 10:
    r2G = 3
elif v2Ghours >= 5:
    r2G = 2
else:
    r2G = 1

# 3G logic
if v3Ghours >= 5:
    r3G = 3
elif v3Ghours >= 3:
    r3G = 2
else:
    r3G = 1

print "r2G=" + `r2G`
print "r3G=" + `r3G`

# Overall score
if r2G < r3G:
    overall = r2G
else:
    overall = r3G

if overall == 1:
    strRate = "Low"
elif overall == 2:
    strRate = "Medium"
else:
    strRate = "High"
    
values = []
values.append(strRate)