wip
This commit is contained in:
@@ -31,7 +31,7 @@ zsum=0
|
|||||||
s:on("receive", function(sck, c)
|
s:on("receive", function(sck, c)
|
||||||
zlen=string.len(c)
|
zlen=string.len(c)
|
||||||
zsum=zsum+zlen
|
zsum=zsum+zlen
|
||||||
print("...zcmpt, zsum, zlen: ",zcmpt,zsum,zlen,string.sub(c,1,100))
|
-- print("...zcmpt, zsum, zlen: ",zcmpt,zsum,zlen,string.sub(c,1,100))
|
||||||
-- print(node.heap())
|
-- print(node.heap())
|
||||||
-- print("len3: "..string.len(zjson))
|
-- print("len3: "..string.len(zjson))
|
||||||
-- print("zjson3: ",string.sub(zjson,1,100))
|
-- print("zjson3: ",string.sub(zjson,1,100))
|
||||||
|
|||||||
+17
-13
@@ -11,7 +11,7 @@ function set_json()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function zget_json_key()
|
function zget_json_key()
|
||||||
print("zget_json_key entrée...",zjson_stat)
|
-- print("zget_json_key entrée...",zjson_stat)
|
||||||
if zjson_stat==1 then
|
if zjson_stat==1 then
|
||||||
p1=string.find(zjson, [["hourly_data":{]])
|
p1=string.find(zjson, [["hourly_data":{]])
|
||||||
if p1~=nil then
|
if p1~=nil then
|
||||||
@@ -23,7 +23,7 @@ function zget_json_key()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if zjson_stat==2 then
|
if zjson_stat==2 then
|
||||||
print("len1: "..string.len(zjson))
|
-- print("len1: "..string.len(zjson))
|
||||||
zjson_key='"'..zh..'H00":{'
|
zjson_key='"'..zh..'H00":{'
|
||||||
print("zjson_key: "..zjson_key)
|
print("zjson_key: "..zjson_key)
|
||||||
p1=string.find(zjson, zjson_key)
|
p1=string.find(zjson, zjson_key)
|
||||||
@@ -31,37 +31,41 @@ function zget_json_key()
|
|||||||
if p1~=nil then
|
if p1~=nil then
|
||||||
zjson=string.sub(zjson,p1)
|
zjson=string.sub(zjson,p1)
|
||||||
print("zjson: ",string.sub(zjson,1,100))
|
print("zjson: ",string.sub(zjson,1,100))
|
||||||
p1,p2=string.find(zjson, '"CONDITION_KEY":"')
|
-- p1,p2=string.find(zjson, '"CONDITION_KEY":"')
|
||||||
|
p1,p2=string.find(zjson, '"APCPsfc":')
|
||||||
|
|
||||||
|
|
||||||
print(p1,p2)
|
print(p1,p2)
|
||||||
if p1~=nil then
|
if p1~=nil then
|
||||||
p3=string.find(zjson, '","',p2)
|
-- p3=string.find(zjson, '","',p2)
|
||||||
|
p3=string.find(zjson, ',',p2)
|
||||||
print(p3)
|
print(p3)
|
||||||
if p3~=nil then
|
if p3~=nil then
|
||||||
ztutu=string.sub(zjson,p2,p3)
|
ztutu=string.sub(zjson,p2+1,p3-1)
|
||||||
print(ztutu)
|
print("ztutu: ",ztutu)
|
||||||
print("len2: "..string.len(zjson))
|
-- print("len2: "..string.len(zjson))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
print("zget_json_key sortie...",zjson_stat)
|
-- print("zget_json_key sortie...",zjson_stat)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
zhmin=7
|
zhmin=10
|
||||||
zhmax=19
|
zhmax=23
|
||||||
zh=zhmin
|
zh=zhmin
|
||||||
zjson_stat=1
|
zjson_stat=1
|
||||||
zjson=""
|
zjson=""
|
||||||
|
|
||||||
function ztoto(c1)
|
function ztoto(c1)
|
||||||
print("ztoto entrée...")
|
-- print("ztoto entrée...")
|
||||||
if zjson=="" then
|
if zjson=="" then
|
||||||
zjson=c1
|
zjson=c1
|
||||||
else
|
else
|
||||||
zjson=zjson..c1
|
zjson=zjson..c1
|
||||||
end
|
end
|
||||||
print("zh: ",zh,"len(zjson): ",string.len(zjson))
|
-- print("zh: ",zh,"len(zjson): ",string.len(zjson))
|
||||||
while zh<=zhmax do
|
while zh<=zhmax do
|
||||||
zget_json_key()
|
zget_json_key()
|
||||||
if p1~=nil then
|
if p1~=nil then
|
||||||
@@ -77,7 +81,7 @@ function ztoto(c1)
|
|||||||
if zh>zhmax then
|
if zh>zhmax then
|
||||||
zjson=""
|
zjson=""
|
||||||
end
|
end
|
||||||
print("ztoto sortie...")
|
-- print("ztoto sortie...")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user