Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
N
node-bigstream
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bs
node-bigstream
Commits
52756a0b
Commit
52756a0b
authored
Feb 01, 2017
by
project
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
f3433634
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
41 deletions
+42
-41
perform.js
plugins/dt/dt-gistda-air/perform.js
+42
-41
No files found.
plugins/dt/dt-gistda-air/perform.js
View file @
52756a0b
...
@@ -11,49 +11,50 @@ function perform_function(context,request,response){
...
@@ -11,49 +11,50 @@ function perform_function(context,request,response){
var
nfiles
=
data
.
data
.
length
;
var
nfiles
=
data
.
data
.
length
;
var
i
=
0
;
var
i
=
0
;
while
(
i
<
nfiles
)
{
while
(
i
<
nfiles
)
{
var
filename
=
data
.
data
[
i
].
filename
;
var
filename
=
data
.
data
[
i
].
filename
;
var
filecontent
=
data
.
data
[
i
].
value
;
var
filecontent
=
data
.
data
[
i
].
value
;
var
arr
=
filecontent
.
toString
().
split
(
"
\
r
\n
"
);
var
arr
=
filecontent
.
toString
().
split
(
"
\
r
\n
"
);
var
arr_type
=
arr
[
1
].
split
(
","
);
var
arr_type
=
arr
[
1
].
split
(
","
);
var
arr_unit
=
arr
[
2
].
split
(
","
);
var
arr_unit
=
arr
[
2
].
split
(
","
);
var
arr_value_type
=
arr
[
3
].
split
(
","
);
var
arr_value_type
=
arr
[
3
].
split
(
","
);
var
ndata
=
arr_type
.
length
;
var
ndata
=
arr_type
.
length
;
var
col
=
1
;
var
col
=
1
;
let
_result
=
{
let
_result
=
{
"object_type"
:
"ibitz"
,
"object_type"
:
"ibitz"
,
"station_id"
:
filename
,
"station_id"
:
filename
,
// need to change to exact station, latitude, longitude
"data"
:[]
"data"
:[]
};
};
while
(
col
<
ndata
)
{
while
(
col
<
ndata
)
{
var
row
=
4
;
var
row
=
4
;
let
values
=
[];
let
values
=
[];
while
(
row
<
arr
.
length
-
1
)
{
while
(
row
<
arr
.
length
-
1
)
{
var
rdata
=
arr
[
row
].
split
(
","
);
var
rdata
=
arr
[
row
].
split
(
","
);
values
.
push
({
values
.
push
({
"observeddatetime"
:
rdata
[
0
].
replace
(
'"'
,
''
).
replace
(
'"'
,
''
),
"observeddatetime"
:
rdata
[
0
].
replace
(
'"'
,
''
).
replace
(
'"'
,
''
),
"value"
:
rdata
[
col
]
"value"
:
rdata
[
col
]
});
row
++
;
}
_result
.
data
.
push
({
"type"
:
arr_type
[
col
].
replace
(
'"'
,
''
).
replace
(
'"'
,
''
),
"unit"
:
arr_unit
[
col
].
replace
(
'"'
,
''
).
replace
(
'"'
,
''
),
"value_type"
:
arr_value_type
[
col
].
replace
(
'"'
,
''
).
replace
(
'"'
,
''
),
"values"
:
values
});
});
row
++
;
}
col
++
;
_result
.
data
.
push
({
}
"type"
:
arr_type
[
col
].
replace
(
'"'
,
''
).
replace
(
'"'
,
''
),
result
.
push
(
_result
);
"unit"
:
arr_unit
[
col
].
replace
(
'"'
,
''
).
replace
(
'"'
,
''
),
i
++
;
"value_type"
:
arr_value_type
[
col
].
replace
(
'"'
,
''
).
replace
(
'"'
,
''
),
}
"values"
:
values
});
response
.
success
(
result
,
output_type
);
//response.reject();
col
++
;
//response.error("error message")
}
result
.
push
(
_result
);
i
++
;
}
response
.
success
(
result
,
output_type
);
//response.reject();
//response.error("error message")
}
}
...
...
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