Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fakeImages
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
fakeImages
Commits
03ed19ed
Commit
03ed19ed
authored
7 years ago
by
Rolf Niepraschk
Browse files
Options
Downloads
Patches
Plain Diff
läuft!
parent
3dc7ce0e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PFEIFFER_SingleGauge/createImages
+166
-0
166 additions, 0 deletions
PFEIFFER_SingleGauge/createImages
with
166 additions
and
0 deletions
PFEIFFER_SingleGauge/createImages
0 → 100755
+
166
−
0
View file @
03ed19ed
#!/bin/bash
#
# Rolf Niepraschk <Rolf.Niepraschk@ptb.de>, 2017-06-28
#
# Erzeugt aus einem leeren Messgeräte-Bild und neun 7-Segment-Bildern
# neue Messgeräte-Bilder
#
# Parameter 1 = Anzahl der erzeugten Bilddateien
#
# Parameter 2 = Anzahl der Einzelzeichen
MAIN
=
"RUSKA7010"
# device name
IMAGE_DIR
=
./images
MAX_DIGITS
=
9
# do not edit!
MAX_FILES
=
10
# do not edit!
NUMBER_OF_DIGITS
=
$MAX_DIGITS
SHOW_EXP
=
true
if
[
-n
"
$1
"
]
;
then
MAX_FILES
=
$1
if
[
-n
"
$2
"
]
;
then
NUMBER_OF_DIGITS
=
$2
fi
fi
rm
-rf
"
$IMAGE_DIR
"
mkdir
-p
"
$IMAGE_DIR
"
emptyCanvas
=
'xc:transparent'
charFile[0]
=
'char-0.png'
charFile[1]
=
'char-1.png'
charFile[2]
=
'char-2.png'
charFile[3]
=
'char-3.png'
charFile[4]
=
'char-4.png'
charFile[5]
=
'char-5.png'
charFile[6]
=
'char-6.png'
charFile[7]
=
'char-7.png'
charFile[8]
=
'char-8.png'
charFile[9]
=
'char-9.png'
charFile[10]
=
'char-minus.png'
charFile[11]
=
$emptyCanvas
charFile[100]
=
'echar-0.png'
charFile[101]
=
'echar-1.png'
charFile[102]
=
'echar-2.png'
charFile[103]
=
'echar-3.png'
charFile[104]
=
'echar-4.png'
charFile[105]
=
'echar-5.png'
charFile[106]
=
'echar-6.png'
charFile[107]
=
'echar-7.png'
charFile[108]
=
'echar-8.png'
charFile[109]
=
'echar-9.png'
charFile[110]
=
'echar-minus.png'
charFile[111]
=
'echar-plus.png'
charFile[112]
=
'echar-E.png'
NUM2CHAR[0]
=
'0'
NUM2CHAR[1]
=
'1'
NUM2CHAR[2]
=
'2'
NUM2CHAR[3]
=
'3'
NUM2CHAR[4]
=
'4'
NUM2CHAR[5]
=
'5'
NUM2CHAR[6]
=
'6'
NUM2CHAR[7]
=
'7'
NUM2CHAR[8]
=
'8'
NUM2CHAR[9]
=
'9'
NUM2CHAR[10]
=
'-'
NUM2CHAR[11]
=
''
NUM2CHAR[100]
=
'0'
NUM2CHAR[101]
=
'1'
NUM2CHAR[102]
=
'2'
NUM2CHAR[103]
=
'3'
NUM2CHAR[104]
=
'4'
NUM2CHAR[105]
=
'5'
NUM2CHAR[106]
=
'6'
NUM2CHAR[107]
=
'7'
NUM2CHAR[108]
=
'8'
NUM2CHAR[109]
=
'9'
NUM2CHAR[110]
=
'-'
NUM2CHAR[111]
=
'+'
NUM2CHAR[112]
=
'E'
charPos[1]
=
'+175+214'
charPos[2]
=
'+203+214'
charPos[3]
=
'+240+214'
charPos[4]
=
'+277+214'
charPos[5]
=
'+314+214'
charPos[6]
=
'+351+214'
charPos[7]
=
'+288+182'
charPos[8]
=
'+305+182'
charPos[9]
=
'+329+182'
dotPos[1]
=
${
charPos
[1]
}
dotPos[2]
=
${
charPos
[2]
}
dotPos[3]
=
${
charPos
[3]
}
dotPos[4]
=
${
charPos
[4]
}
dotPos[5]
=
${
charPos
[5]
}
dotPos[6]
=
${
charPos
[6]
}
for
((
FNb
=
1
;
FNb<
=
MAX_FILES
;
FNb++
))
;
do
DPR
=
$((
RANDOM
%
5
+
2
))
# random dot position (2..6)
value
=
""
for
((
i
=
1
;
i<
=
$MAX_DIGITS
;
i++
))
;
do
if
((
$i
<
=
$NUMBER_OF_DIGITS
))
;
then
if
((
$i
==
1
))
;
then
# sign of matissa
R
=
$((
RANDOM
%
2
+
10
))
# random number (10..11='-'..' ')
eval
CHAR
$i
=
${
charFile
[R]
}
value+
=
"
${
NUM2CHAR
[R]
}
"
elif
((
$i
<
=
6
))
;
then
# matissa
R
=
$((
RANDOM
%
10
))
# random number (0..9='0'..'9')
eval
CHAR
$i
=
${
charFile
[R]
}
value+
=
"
${
NUM2CHAR
[R]
}
"
if
((
$DPR
==
$i
))
;
then
eval
DOT
$i
=
"char-dot.png"
value+
=
"."
else
eval
DOT
$i
=
$emptyCanvas
;
fi
else
# exponent
R
=
$((
RANDOM
%
13
+
100
))
# random number (100..112='0'..'E')
eval
CHAR
$i
=
${
charFile
[R]
}
value+
=
"
${
NUM2CHAR
[R]
}
"
fi
else
eval
CHAR
$i
=
$emptyCanvas
;
eval
DOT
$i
=
$emptyCanvas
;
fi
done
# NUMBER_OF_DIGITS
fname
=
"
$IMAGE_DIR
/
$MAIN
@
$value
@.png"
echo
-e
"
$FNb
:
\t
$fname
"
convert body.png
\
$CHAR1
-geometry
${
charPos
[1]
}
-composite
\
$CHAR2
-geometry
${
charPos
[2]
}
-composite
\
$DOT2
-geometry
${
dotPos
[2]
}
-composite
\
$CHAR3
-geometry
${
charPos
[3]
}
-composite
\
$DOT3
-geometry
${
dotPos
[3]
}
-composite
\
$CHAR4
-geometry
${
charPos
[4]
}
-composite
\
$DOT4
-geometry
${
dotPos
[4]
}
-composite
\
$CHAR5
-geometry
${
charPos
[5]
}
-composite
\
$DOT5
-geometry
${
dotPos
[5]
}
-composite
\
$CHAR6
-geometry
${
charPos
[6]
}
-composite
\
$DOT6
-geometry
${
dotPos
[6]
}
-composite
\
$CHAR7
-geometry
${
charPos
[7]
}
-composite
\
$CHAR8
-geometry
${
charPos
[8]
}
-composite
\
$CHAR9
-geometry
${
charPos
[9]
}
-composite
\
$fname
exiv2
-M
"set Exif.Image.ImageDescription value=
$value
"
$fname
done
# MAX_FILES
exit
-----------------------------------------------------------------------
Auslesen der Exif-Daten:
exiv2
-g
Exif.Image.ImageDescription
-P
v ./images/ADIXEN@???@.png
--
>
value
=
???
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