Subversion Repositories SmartDukaan

Rev

Rev 1312 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1226 rajveer 1
if vars().has_key('expSlide'):
2
    print "expSlide=" + `expSlide`
3
 
4
# Pick 2G and 3G Feature objects
5
threeGFeature = None
6
v3Ghours = None
7
expandedFeatures = expSlide.getExpandedFeatures()
8
for expandedFeature in expandedFeatures:
9
    label = expandedFeature.getFeatureDefinition().getLabel()
10
    if label == "2G":
11
        twoGFeature = expandedFeature
12
    elif label == "3G":
13
        threeGFeature = expandedFeature 
14
 
15
twoGBullets = twoGFeature.getExpandedBullets()
16
 
17
# Is a single-value field
18
twoGBullet = twoGBullets[0]
19
v2G = twoGBullet.getValue()
20
print "v2G=" + `v2G`
21
v2Gparts = v2G.split()
22
 
23
# Take only hours
24
v2Ghours = float(v2Gparts[0])
25
print "v2Ghours=" + `v2Ghours`
26
 
27
if threeGFeature is not None:        
28
    threeGBullets = threeGFeature.getExpandedBullets()
29
 
30
    # Is a single-value field
31
    threeGBullet = threeGBullets[0]
32
    v3G = threeGBullet.getValue()
33
    print "v3G=" + `v3G`
34
    v3Gparts = v3G.split()
35
 
36
    # Take only hours
37
    v3Ghours = float(v3Gparts[0])
38
    print "v3Ghours=" + `v3Ghours`
39
 
40
# Rough values
41
# 2G High > 10, Medium > 5 else Low
42
# 3G High > 5, Medium > 3 else Low
43
 
44
# Overall: Highest of both e.g. if 2G:Low and 3G:Medium, Overall:Medium
45
 
46
# 1 - Low
47
# 2 - Medium
48
# 3 - High
49
 
50
# 2G logic
51
if v2Ghours >= 10:
52
    r2G = 3
53
elif v2Ghours >= 5:
54
    r2G = 2
55
else:
56
    r2G = 1
57
 
58
# 3G logic
59
if v3Ghours >= 5:
60
    r3G = 3
61
elif v3Ghours >= 3:
62
    r3G = 2
63
else:
64
    r3G = 1
65
 
66
print "r2G=" + `r2G`
67
print "r3G=" + `r3G`
68
 
69
# Overall score
70
if r2G < r3G:
71
    overall = r2G
72
else:
73
    overall = r3G
74
 
75
if overall == 1:
76
    strRate = "Low"
77
elif overall == 2:
78
    strRate = "Medium"
79
else:
80
    strRate = "High"
81
 
82
values = []
83
values.append(strRate)