Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
middleware
/
rtm_services
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9ec27f82
authored
Jul 10, 2019
by
Tomasz Ciesielczyk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
data storage bug fix
parent
db231b3a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
33 deletions
+46
-33
lib/lightstorage.jar
+0
-0
m2dc-rtm-rest/src/main/kotlin/psnc/m2dc/rtm/commands/java/Version.kt
+2
-2
m2dc-rtm-restclient/src/main/kotlin/psnc/m2dc/rtm/client/Version.kt
+2
-2
m2dc-rtm-utils/src/main/kotlin/psnc/m2dc/rtm/dao/ResourceDAO.kt
+8
-0
m2dc-rtm-utils/src/main/kotlin/psnc/m2dc/rtm/dao/SettingsDAO.kt
+34
-29
No files found.
lib/lightstorage.jar
View file @
9ec27f82
No preview for this file type
m2dc-rtm-rest/src/main/kotlin/psnc/m2dc/rtm/commands/java/Version.kt
View file @
9ec27f82
package
psnc.m2dc.rtm.commands.java
val
APP_VERSION
=
"1.0.646_62715"
\ No newline at end of file
val
APP_VERSION
=
"1.0.647_42725"
\ No newline at end of file
m2dc-rtm-restclient/src/main/kotlin/psnc/m2dc/rtm/client/Version.kt
View file @
9ec27f82
package
psnc.m2dc.rtm.client
const
val
APP_VERSION
=
"1.1.646_62715"
\ No newline at end of file
const
val
APP_VERSION
=
"1.1.647_42726"
\ No newline at end of file
m2dc-rtm-utils/src/main/kotlin/psnc/m2dc/rtm/dao/ResourceDAO.kt
View file @
9ec27f82
...
...
@@ -102,6 +102,14 @@ class ResourceDAO(val storage: TreeStorage) {
fun
getNodes
():
Map
<
String
,
Resource
>
{
val
obj
=
LightStorage
.
getObjectsTree
(
"nodes"
)
// val _obj_list= LightStorage.instance.getNodes("nodes")
// val _obj = obj.values.firstOrNull()!!
// val __obj_list=obj.values.first()
// val __obj = _obj.makeObject()
// val ___obj_list=__obj_list.makeObject()
// val ___obj = RTMProperties.JSONParser.fromJson<Resource>(__obj!!.toJsonObj(), object : TypeToken<Resource>() {}.type)
val
m
=
LightStorage
.
convert
<
Resource
>(
obj
)
return
m
.
map
{
it
.
id
to
it
}.
toMap
()
}
...
...
m2dc-rtm-utils/src/main/kotlin/psnc/m2dc/rtm/dao/SettingsDAO.kt
View file @
9ec27f82
...
...
@@ -139,20 +139,23 @@ object SettingsDAO : DataDAO() {
var
suspendPowerUsage
:
Double
?
=
null
var
actions
=
false
f
.
forEachLine
{
val
fields
=
it
.
split
(
"\t"
)
if
(
it
.
startsWith
(
"actions"
))
{
actions
=
true
}
if
(
first
)
{
min0
=
fields
[
0
].
toDouble
()
min100
=
fields
[
2
].
toDouble
()
max0
=
fields
[
1
].
toDouble
()
max100
=
fields
[
3
].
toDouble
()
suspendPowerUsage
=
fields
[
4
].
toDoubleOrNull
()
first
=
false
}
else
if
(!
actions
)
{
if
(
fields
.
isNotEmpty
())
{
set
.
add
(
fields
[
0
].
toDouble
())
if
(!
it
.
startsWith
(
"#"
))
{
val
fields
=
it
.
split
(
"\t"
)
if
(
it
.
startsWith
(
"actions"
))
{
actions
=
true
//break loop?
}
if
(
first
)
{
min0
=
fields
[
0
].
toDouble
()
min100
=
fields
[
2
].
toDouble
()
max0
=
fields
[
1
].
toDouble
()
max100
=
fields
[
3
].
toDouble
()
suspendPowerUsage
=
fields
[
4
].
toDoubleOrNull
()
first
=
false
}
else
if
(!
actions
)
{
if
(
fields
.
isNotEmpty
())
{
set
.
add
(
fields
[
0
].
toDouble
())
}
}
}
...
...
@@ -174,21 +177,23 @@ object SettingsDAO : DataDAO() {
var
first
=
true
var
actions
=
""
f
.
forEachLine
{
line
->
val
lineFields
=
line
.
split
(
"\t"
)
if
(
first
)
{
first
=
false
}
else
if
(!
line
.
startsWith
(
"actions"
)
&&
actions
.
isEmpty
())
{
cm
.
setPower
(
PowerMeasurement
.
init
(
powerSetting
=
lineFields
[
0
].
toDouble
(),
modelDetails
=
pm
,
power
=
lineFields
[
1
].
toDoubleOrNull
(),
utilization
=
lineFields
[
3
].
toDoubleOrNull
()
?:
defaultUtilization
,
performance
=
lineFields
[
2
].
toDoubleOrNull
()
),
pm
.
min0
)
}
else
if
(
line
.
startsWith
(
"actions"
))
{
actions
=
" "
}
else
{
actions
+=
line
if
(!
line
.
startsWith
(
"#"
))
{
val
lineFields
=
line
.
split
(
"\t"
)
if
(
first
)
{
first
=
false
}
else
if
(!
line
.
startsWith
(
"actions"
)
&&
actions
.
isEmpty
())
{
cm
.
setPower
(
PowerMeasurement
.
init
(
powerSetting
=
lineFields
[
0
].
toDouble
(),
modelDetails
=
pm
,
power
=
lineFields
[
1
].
toDoubleOrNull
(),
utilization
=
lineFields
[
3
].
toDoubleOrNull
()
?:
defaultUtilization
,
performance
=
lineFields
[
2
].
toDoubleOrNull
()
),
pm
.
min0
)
}
else
if
(
line
.
startsWith
(
"actions"
))
{
actions
=
" "
}
else
{
actions
+=
line
}
}
}
if
(
actions
.
length
>
2
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment