diff --git a/src/files.jl b/src/files.jl index 80dc877957a2f2e8e09be62d6b1793e582a4f813..022ea3ebd469d2b505d06125adc1f7705d1fc359 100644 --- a/src/files.jl +++ b/src/files.jl @@ -118,20 +118,42 @@ function tryopenfile(controller, path; reload::Bool=false) push!(tag_lut, ObservableTag(original; color=color, active=true)) end elseif hasproperty(records, :tags) + # trx.mat tags default_convention = Dict( - :small_motion => :grey50, - :stop_large => :green, - :run_large => :black, + :back_large => :cyan, :cast_large => :red, :hunch_large => :blue, - :back_large => :cyan, :roll_large => :yellow, + :run_large => :black, + :small_motion => :grey50, + :stop_large => :green, ) + related_tags = Dict( + :back => :back_large, + :back_weak => :back_large, + :back_strong => :back_large, + :cast => :cast_large, + :cast_weak => :cast_large, + :cast_strong => :cast_large, + :hunch => :hunch_large, + :hunch_weak => :hunch_large, + :hunch_strong => :hunch_large, + :roll => :roll_large, + :roll_weak => :roll_large, + :roll_strong => :roll_large, + :run => :run_large, + :run_weak => :run_large, + :run_strong => :run_large, + :stop => :stop_large, + :stop_weak => :stop_large, + :stop_strong => :stop_large, + ) fallback_color = theme[:LarvaPlot][:fallback_color] existingtags = records.tags for tag in existingtags active = tag in keys(default_convention) - color = active ? default_convention[tag] : fallback_color + tag′= active ? tag : get(related_tags, tag, tag) + color = get(default_convention, tag′, fallback_color) original = TagModel(tag) push!(tag_lut, ObservableTag(original; color=color, active=active)) end