32 |
32 |
33 _LIT(KDMLIGLSSHNDynamicResource, "DynamicResource2"); |
33 _LIT(KDMLIGLSSHNDynamicResource, "DynamicResource2"); |
34 DMLIGLSSHNDynamicResource::DMLIGLSSHNDynamicResource() : DDynamicPowerResource(KDMLIGLSSHNDynamicResource, -5), iMinLevel(-5), iMaxLevel(-10), iCurrentLevel(-5) |
34 DMLIGLSSHNDynamicResource::DMLIGLSSHNDynamicResource() : DDynamicPowerResource(KDMLIGLSSHNDynamicResource, -5), iMinLevel(-5), iMaxLevel(-10), iCurrentLevel(-5) |
35 { |
35 { |
36 iFlags = KMultiLevel | KLongLatencySet | KShared | KSenseNegative; |
36 iFlags = KMultiLevel | KLongLatencySet | KShared | KSenseNegative; |
37 NKern::LockSystem(); |
37 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
38 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
39 NKern::UnlockSystem(); |
|
40 } |
38 } |
41 |
39 |
42 _LIT(KDBLGLSSHNDynamicResource, "DynamicResource3"); |
40 _LIT(KDBLGLSSHNDynamicResource, "DynamicResource3"); |
43 DBLGLSSHNDynamicResource::DBLGLSSHNDynamicResource() : DDynamicPowerResource(KDBLGLSSHNDynamicResource, 1), iMinLevel(1), iMaxLevel(0), iCurrentLevel(1) |
41 DBLGLSSHNDynamicResource::DBLGLSSHNDynamicResource() : DDynamicPowerResource(KDBLGLSSHNDynamicResource, 1), iMinLevel(1), iMaxLevel(0), iCurrentLevel(1) |
44 { |
42 { |
45 iFlags = KBinary | KLongLatencySet | KLongLatencyGet | KShared | KSenseNegative; |
43 iFlags = KBinary | KLongLatencySet | KLongLatencyGet | KShared | KSenseNegative; |
46 NKern::LockSystem(); |
44 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
47 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
48 NKern::UnlockSystem(); |
|
49 } |
45 } |
50 |
46 |
51 _LIT(KDMLLGLSSHPDynamicResource, "DynamicResource4"); |
47 _LIT(KDMLLGLSSHPDynamicResource, "DynamicResource4"); |
52 DMLLGLSSHPDynamicResource::DMLLGLSSHPDynamicResource() : DDynamicPowerResource(KDMLLGLSSHPDynamicResource, 10), iMinLevel(10), iMaxLevel(20), iCurrentLevel(10) |
48 DMLLGLSSHPDynamicResource::DMLLGLSSHPDynamicResource() : DDynamicPowerResource(KDMLLGLSSHPDynamicResource, 10), iMinLevel(10), iMaxLevel(20), iCurrentLevel(10) |
53 { |
49 { |
54 iFlags = KMultiLevel | KLongLatencySet | KLongLatencyGet | KShared; |
50 iFlags = KMultiLevel | KLongLatencySet | KLongLatencyGet | KShared; |
55 NKern::LockSystem(); |
51 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
56 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
57 NKern::UnlockSystem(); |
|
58 } |
52 } |
59 |
53 |
60 //Constructors for dynamic dependent resources |
54 //Constructors for dynamic dependent resources |
61 _LIT(KDDynamicResourceD01, "DynamicDependResourceDH"); |
55 _LIT(KDDynamicResourceD01, "DynamicDependResourceDH"); |
62 DDynamicResourceD01::DDynamicResourceD01() : DDynamicPowerResourceD(KDDynamicResourceD01, 75), iMinLevel(75), iMaxLevel(90), iCurrentLevel(75) |
56 DDynamicResourceD01::DDynamicResourceD01() : DDynamicPowerResourceD(KDDynamicResourceD01, 75), iMinLevel(75), iMaxLevel(90), iCurrentLevel(75) |
63 { |
57 { |
64 // Make it a Instantaneous Resource. |
58 // Make it a Instantaneous Resource. |
65 iFlags = KMultiLevel; |
59 iFlags = KMultiLevel; |
66 NKern::LockSystem(); |
60 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
67 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
68 NKern::UnlockSystem(); |
|
69 } |
61 } |
70 |
62 |
71 _LIT(KDDynamicResourceD02, "DynamicDependResourceDI"); |
63 _LIT(KDDynamicResourceD02, "DynamicDependResourceDI"); |
72 DDynamicResourceD02::DDynamicResourceD02() : DDynamicPowerResourceD(KDDynamicResourceD02, 0), iMinLevel(0), iMaxLevel(1), iCurrentLevel(0) |
64 DDynamicResourceD02::DDynamicResourceD02() : DDynamicPowerResourceD(KDDynamicResourceD02, 0), iMinLevel(0), iMaxLevel(1), iCurrentLevel(0) |
73 { |
65 { |
74 iFlags = KBinary | KLongLatencySet | KLongLatencyGet | KShared; |
66 iFlags = KBinary | KLongLatencySet | KLongLatencyGet | KShared; |
75 NKern::LockSystem(); |
67 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
76 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
77 NKern::UnlockSystem(); |
|
78 } |
68 } |
79 |
69 |
80 _LIT(KDDynamicResourceD03, "DynamicDependResourceDJ"); |
70 _LIT(KDDynamicResourceD03, "DynamicDependResourceDJ"); |
81 DDynamicResourceD03::DDynamicResourceD03() : DDynamicPowerResourceD(KDDynamicResourceD03, 19), iMinLevel(19), iMaxLevel(9), iCurrentLevel(19) |
71 DDynamicResourceD03::DDynamicResourceD03() : DDynamicPowerResourceD(KDDynamicResourceD03, 19), iMinLevel(19), iMaxLevel(9), iCurrentLevel(19) |
82 { |
72 { |
83 iFlags = KMultiLevel | KLongLatencySet | KShared | KSenseNegative; |
73 iFlags = KMultiLevel | KLongLatencySet | KShared | KSenseNegative; |
84 NKern::LockSystem(); |
74 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
85 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
86 NKern::UnlockSystem(); |
|
87 } |
75 } |
88 |
76 |
89 _LIT(KDDynamicResourceD04, "DynamicDependResourceDK"); |
77 _LIT(KDDynamicResourceD04, "DynamicDependResourceDK"); |
90 DDynamicResourceD04::DDynamicResourceD04() : DDynamicPowerResourceD(KDDynamicResourceD04, 0), iMinLevel(0), iMaxLevel(1), iCurrentLevel(0) |
78 DDynamicResourceD04::DDynamicResourceD04() : DDynamicPowerResourceD(KDDynamicResourceD04, 0), iMinLevel(0), iMaxLevel(1), iCurrentLevel(0) |
91 { |
79 { |
92 iFlags = KBinary | KLongLatencySet; |
80 iFlags = KBinary | KLongLatencySet; |
93 NKern::LockSystem(); |
81 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
94 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
95 NKern::UnlockSystem(); |
|
96 } |
82 } |
97 |
83 |
98 //Get info implementation for dynamic resources |
84 //Get info implementation for dynamic resources |
99 TInt DBIGISSPDynamicResource::GetInfo(TDes8* info) const |
85 TInt DBIGISSPDynamicResource::GetInfo(TDes8* info) const |
100 { |
86 { |