rr: add show method

develop
Kinch 2023-10-10 14:07:25 +02:00
parent 7324577fb3
commit b8b89d425d
1 changed files with 17 additions and 17 deletions

View File

@ -69,25 +69,25 @@ function list_field_types(xs_result)
return result
end
function filename(str)
local name = string.gsub(str, "(.*/)(.*)", "%2")
return name
end
--local ms_form = rr.json("/Users/tbr/Desktop/ms_form.json")
local xs_result = rr.json("/Volumes/data/problematics/10138832-0ec5-4ea9-bf9e-2d863f714b6c-result.json")
function show(name, document, xs_result_path)
local xs_result = rr.json(xs_result_path)
local xs_fields = group_by_type(xs_result)
local record = rr.recording("fix")
record:image("steets_city_mixup", "/Volumes/data/problematics/street_city_mixup.png")
local record = rr.recording(name)
record:image(name, document)
for field_type, fields in pairs(xs_fields) do
for field_name, sub_fields in pairs(fields) do
record:text_objects("steets_city_mixup/" .. field_type .. "/" .. field_name, sub_fields)
record:text_objects(name .. "/" .. field_type .. "/" .. field_name, sub_fields)
end
end
end
local master = "/Volumes/data/problematics/10138832-0ec5-4ea9-bf9e-2d863f714b6c-result.json"
local fix = "/Volumes/data/problematics/10138832-0ec5-4ea9-bf9e-2d863f714b6c-result.json"
--local master_xs_result = rr.json("/Volumes/data/problematics/0636036f-6ade-41db-8fbe-1a97b2cdb6ca-result.json")
--local master_fields = group_by_type(master_xs_result)
--local master_record = rr.recording("master")
--master_record:image("steets_city_mixup", "/Volumes/data/problematics/street_city_mixup.png")
--for field_type, fields in pairs(master_fields) do
-- for field_name, sub_fields in pairs(fields) do
-- master_record:text_objects("steets_city_mixup/" .. field_type .. "/" .. field_name, sub_fields)
-- end
--end
show("master","/Volumes/data/problematics/street_city_mixup.png", master )
show("fix","/Volumes/data/problematics/street_city_mixup.png", fix )