Skip to content

Commit 37c7096

Browse files
committed
Initial version (based on ModiaResult_CairoMakie)
0 parents  commit 37c7096

File tree

7 files changed

+162
-0
lines changed

7 files changed

+162
-0
lines changed

.github/workflows/TagBot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: 3
10+
permissions:
11+
contents: write
12+
jobs:
13+
TagBot:
14+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: JuliaRegistries/TagBot@v1
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Manifest.toml

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021-2022 DLR Institute of System Dynamics and Control
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Project.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name = "SignalTablesInterface_CairoMakie"
2+
uuid = "9a677d73-819a-4685-8db0-bdf9b06384c4"
3+
4+
version = "0.1.0"
5+
6+
[deps]
7+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
8+
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
9+
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
10+
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
11+
MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca"
12+
SignalTables = "3201582d-3078-4276-ba5d-0a1254d79d7c"
13+
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
14+
15+
[compat]
16+
CairoMakie = "0.8"
17+
Colors = "0.12, 0.11, 0.10"
18+
DataFrames = "1, 0.22, 0.21, 0.20, 0.19"
19+
Measurements = "2"
20+
MonteCarloMeasurements = "1, 0.10"
21+
SignalTables = "0.3"
22+
Unitful = "1"
23+
julia = "1.7"
24+
25+
[extras]
26+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
27+
28+
[targets]
29+
test = ["Test"]

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SignalTablesInterface_CairoMakie
2+
3+
This package is an interface from [SignalTables](https://github.com/ModiaSim/SignalTables.jl) to
4+
[CairoMakie](https://github.com/JuliaPlots/Makie.jl) (= Julia interface to backend CairoMakie of Makie.jl)
5+
in order to be able to perform convenient line plots in SignalTables via CairoMakie.
6+
7+
This package is usually not directly used, but is activated via package
8+
[SignalTables](https://github.com/ModiaSim/SignalTables.jl).
9+
For details of the installation and the usage,
10+
see the [SignalTables documentation](https://modiasim.github.io/SignalTables.jl/stable/index.html).
11+
12+
13+
## Main developer
14+
15+
[Martin Otter](https://rmc.dlr.de/sr/en/staff/martin.otter/),
16+
[DLR - Institute of System Dynamics and Control](https://www.dlr.de/sr/en)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
module SignalTablesInterface_CairoMakie
2+
3+
4+
# Constants
5+
const headingSize = 10
6+
7+
const path = dirname(dirname(@__FILE__)) # Absolute path of package directory
8+
const Version = "0.1.0"
9+
const Date = "2022-07-04"
10+
11+
println("Importing SignalTablesInterface_CairoMakie Version $Version ($Date) - this takes some time due to CairoMakie import")
12+
13+
import SignalTables
14+
import Colors
15+
import Measurements
16+
import MonteCarloMeasurements
17+
using Unitful
18+
19+
using CairoMakie
20+
include("$(SignalTables.path)/src/AbstractPlotInterface.jl")
21+
22+
const showFigureStringInDiagram = false
23+
const callDisplayFunction = false
24+
const reusePossible = true
25+
26+
const Makie_Point2f = isdefined(CairoMakie, :Point2f) ? Point2f : Point2f0
27+
include("$(SignalTables.path)/src/makie.jl")
28+
29+
30+
showFigure(figureNumber::Int) = nothing
31+
32+
function saveFigure(figureNumber::Int, fileName; kwargs...)::Nothing
33+
if haskey(figures, figureNumber)
34+
fig = figures[figureNumber].fig
35+
fullFileName = joinpath(pwd(), fileName)
36+
println("... save plot in file: \"$fullFileName\"")
37+
save(fileName, fig; kwargs...)
38+
else
39+
@info "saveFigure: figure $figureNumber is not defined."
40+
end
41+
return nothing
42+
end
43+
44+
45+
function closeFigure(figureNumber::Int)::Nothing
46+
delete!(figures,figureNumber)
47+
return nothing
48+
end
49+
50+
51+
"""
52+
closeAllFigures()
53+
54+
Close all figures.
55+
"""
56+
function closeAllFigures()::Nothing
57+
if length(figures) > 0
58+
empty!(figures)
59+
end
60+
return nothing
61+
end
62+
63+
64+
end

test/runtests.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module SignalTablesInterface_CairoMakie_runtests
2+
3+
import SignalTables
4+
using Test
5+
6+
@testset "Test SignalTablesInterface_CairoMakie/test" begin
7+
SignalTables.usePlotPackage("CairoMakie")
8+
include("$(SignalTables.path)/test/include_all.jl")
9+
SignalTables.usePreviousPlotPackage()
10+
end
11+
12+
end

0 commit comments

Comments
 (0)