This commit is contained in:
narawat lamaiin
2024-08-14 21:21:44 +07:00
parent 38a2f673e9
commit 2c095a584b
5 changed files with 250 additions and 80 deletions

View File

@@ -1,6 +1,6 @@
module util
export clearhistory, addNewMessage, vectorOfDictToText
export clearhistory, addNewMessage, vectorOfDictToText, eventdict
using UUIDs, Dates, DataStructures, HTTP, MQTTClient, JSON3
using GeneralUtils
@@ -153,7 +153,29 @@ function vectorOfDictToText(vecd::Vector; withkey=true)
end
function eventdict(;
event_description::Union{String, Nothing}=nothing,
timestamp::Union{DateTime, Nothing}=nothing,
subject::Union{String, Nothing}=nothing,
action_or_dialogue::Union{String, Nothing}=nothing,
location::Union{String, Nothing}=nothing,
equipment_used::Union{String, Nothing}=nothing,
material_used::Union{String, Nothing}=nothing,
outcome::Union{String, Nothing}=nothing,
note::Union{String, Nothing}=nothing,
)
return Dict{Symbol, Any}(
:event_description=> event_description,
:timestamp=> timestamp,
:subject=> subject,
:action_or_dialogue=> action_or_dialogue,
:location=> location,
:equipment_used=> equipment_used,
:material_used=> material_used,
:outcome=> outcome,
:note=> note,
)
end