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
9e3b07bb
Commit
9e3b07bb
authored
7 years ago
by
Rolf Niepraschk
Browse files
Options
Downloads
Patches
Plain Diff
läuft!
parent
13c5e046
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PFEIFFER_DualGauge/createImages
+20
-68
20 additions, 68 deletions
PFEIFFER_DualGauge/createImages
with
20 additions
and
68 deletions
PFEIFFER_DualGauge/createImages
+
20
−
68
View file @
9e3b07bb
...
...
@@ -9,9 +9,9 @@
#
# Parameter 2 = Anzahl der Einzelzeichen
MAIN
=
"
RUSKA7010
"
# device name
MAIN
=
"
PFEIFFER_DualGauge
"
# device name
IMAGE_DIR
=
./images
MAX_DIGITS
=
9
# do not edit!
MAX_DIGITS
=
6
# do not edit!
MAX_FILES
=
10
# do not edit!
NUMBER_OF_DIGITS
=
$MAX_DIGITS
...
...
@@ -40,21 +40,6 @@ 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'
...
...
@@ -67,31 +52,13 @@ 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'
charPos[1]
=
'+169+199'
charPos[2]
=
'+198+199'
charPos[3]
=
'+227+199'
charPos[4]
=
'+256+199'
charPos[5]
=
'+285+199'
charPos[6]
=
'+314+199'
dotPos[1]
=
${
charPos
[1]
}
dotPos[2]
=
${
charPos
[2]
}
...
...
@@ -102,33 +69,20 @@ dotPos[6]=${charPos[6]}
for
((
FNb
=
1
;
FNb<
=
MAX_FILES
;
FNb++
))
;
do
DPR
=
$((
RANDOM
%
5
+
2
))
# random dot position (
2
..6)
DPR
=
$((
RANDOM
%
6
+
1
))
# random dot position (
1
..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]
}
"
R
=
$((
RANDOM
%
11
))
# random number (0..10='0'..'-')
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
eval
CHAR
$i
=
$emptyCanvas
;
eval
DOT
$i
=
$emptyCanvas
;
fi
fi
done
# NUMBER_OF_DIGITS
fname
=
"
$IMAGE_DIR
/
$MAIN
@
$value
@.png"
...
...
@@ -137,6 +91,7 @@ echo -e "$FNb:\t$fname"
convert body.png
\
$CHAR1
-geometry
${
charPos
[1]
}
-composite
\
$DOT1
-geometry
${
dotPos
[1]
}
-composite
\
$CHAR2
-geometry
${
charPos
[2]
}
-composite
\
$DOT2
-geometry
${
dotPos
[2]
}
-composite
\
$CHAR3
-geometry
${
charPos
[3]
}
-composite
\
...
...
@@ -147,9 +102,6 @@ convert body.png \
$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
...
...
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