Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
DevHub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vaclab
DevHub
Commits
1937004e
Commit
1937004e
authored
2 years ago
by
Thomas Bock
Browse files
Options
Downloads
Patches
Plain Diff
Fluke RPM4 pp
parent
593b3747
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/devhub/pp.clj
+5
-0
5 additions, 0 deletions
src/devhub/pp.clj
src/devhub/pp_scripts/rpm4.clj
+40
-0
40 additions, 0 deletions
src/devhub/pp_scripts/rpm4.clj
with
45 additions
and
0 deletions
src/devhub/pp.clj
+
5
−
0
View file @
1937004e
...
...
@@ -9,6 +9,7 @@
[
devhub.pp-scripts.servo-se3
:as
servo-se3
]
[
devhub.pp-scripts.servo-ppc
:as
servo-ppc
]
[
devhub.pp-scripts.im540
:as
im540
]
[
devhub.pp-scripts.rpm4
:as
rpm4
]
[
devhub.pp-scripts.inf-cube
:as
inf-cube
]
[
devhub.pp-scripts.inf-vgc
:as
inf-vgc
]
[
devhub.pp-scripts.inf-bcg450
:as
inf-bcg450
]
...
...
@@ -97,6 +98,10 @@
:inf-vgc.read-out
(
inf-vgc/read-out
task
)
:inf-vgc.read-vec
(
inf-vgc/read-vec
task
)
:rpm4.read-vec
(
rpm4/read-vec
task
)
:rpm4.read-out
(
rpm4/read-out
task
)
{
:error
(
str
"no :PostScript named: "
ps
)}))
(
defn
pre-dispatch
[
conf
{
ps
:PreScript
:as
task
}]
...
...
This diff is collapsed.
Click to expand it.
src/devhub/pp_scripts/rpm4.clj
0 → 100644
+
40
−
0
View file @
1937004e
(
ns
devhub.pp-scripts.rpm4
^
{
:author
"Thomas Bock <wactbprot@gmail.com>"
:doc
"Post processing for Fluke/Europascal PPC/RPM4."
}
(
:require
[
devhub.pp-utils
:as
ppu
]
[
devhub.utils
:as
u
]
[
clojure.string
:as
string
]))
(
comment
(
def
test-vec
[
"R 0.078 mbara"
"R 0.078 mbara"
"R 33.076 mbara"
"R 111111.079 mbara"
"R 222.078 mbara"
])
(
mapv
extract-value
test-vec
)
;; => [0.078 0.078 33.076 111111.079 222.078]
(
mapv
extract-unit
test-vec
)
;; => ["mbar" "mbar" "mbar" "mbar" "mbar"]
,,,
)
(
defn
extract
[
s
]
(
let
[
r
#
"^R\s*([0-9]*\.[0-9]*)\s([a-zA-Z]*)a$"
]
(
re-matches
r
s
)))
(
defn
extract-value
[
s
]
(
->
s
extract
second
u/number
))
(
defn
extract-unit
[
s
]
(
->
s
extract
last
)
(
defn
read-vec
[{
x
:_x
:as
task
}]
(
assoc
task
:Result
[{
:Type
(
get-in
task
[
:PostScriptInput
:Type
])
:Value
(
mapv
extract-value
x
)
:Unit
(
extract-unit
(
first
x
))}]))
(
defn
read-out
[{
x
:_x
:as
task
}]
(
assoc
task
:Result
[(
ppu/vl-result
(
get-in
task
[
:PostScriptInput
:Type
])
(
->>
(
mapv
extract-value
x
)
(
drop
2
)
vec
)
(
extract-unit
(
first
x
)))]))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment