machine_setup 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ MIT-LICENSE
data/.gitignore ADDED
@@ -0,0 +1,27 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## RubyMine
22
+ .idea
23
+
24
+ ## PROJECT::SPECIFIC
25
+
26
+ /test/trans.rb
27
+ /test/y.rb
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 robi-wan
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,17 @@
1
+ = machine_setup
2
+
3
+ Generating configuration files for a machine setup.
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
+ * Send me a pull request. Bonus points for topic branches.
14
+
15
+ == License
16
+
17
+ MIT License. See the included MIT-LICENSE file.
data/Rakefile ADDED
@@ -0,0 +1,54 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "machine_setup"
8
+ gem.executables = ["setup_config_gen.rb"]
9
+ gem.summary = %Q{Generating configuration for machine setup parameters.}
10
+ gem.description = %Q{Helps generating configuration files for machine setup parameters.}
11
+ gem.email = "robi-wan@suyu.de"
12
+ gem.homepage = "http://github.com/robi-wan/machine_setup"
13
+ gem.authors = ["robi-wan"]
14
+ gem.add_runtime_dependency "i18n", ">= 0.3.0"
15
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
+ end
17
+ Jeweler::GemcutterTasks.new
18
+ rescue LoadError
19
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
20
+ end
21
+
22
+ require 'rake/testtask'
23
+ Rake::TestTask.new(:test) do |test|
24
+ test.libs << 'lib' << 'test'
25
+ test.pattern = 'test/**/test_*.rb'
26
+ test.verbose = true
27
+ end
28
+
29
+ begin
30
+ require 'rcov/rcovtask'
31
+ Rcov::RcovTask.new do |test|
32
+ test.libs << 'test'
33
+ test.pattern = 'test/**/test_*.rb'
34
+ test.verbose = true
35
+ end
36
+ rescue LoadError
37
+ task :rcov do
38
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
39
+ end
40
+ end
41
+
42
+ task :test => :check_dependencies
43
+
44
+ task :default => :test
45
+
46
+ require 'rake/rdoctask'
47
+ Rake::RDocTask.new do |rdoc|
48
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
+
50
+ rdoc.rdoc_dir = 'rdoc'
51
+ rdoc.title = "plc_version_deploy #{version}"
52
+ rdoc.rdoc_files.include('README*')
53
+ rdoc.rdoc_files.include('lib/**/*.rb')
54
+ end
data/TODO ADDED
@@ -0,0 +1,9 @@
1
+ - complete underleaver example
2
+
3
+ - rename drive params to make meaning more clear
4
+
5
+ - generate import file for epas with parameter numbers
6
+
7
+ - code cleanup
8
+
9
+ - add support for min-max-parameters (programme parameters)
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ param_def=ARGV[0]
3
+
4
+ throw RuntimeError.new("parameter definition nicht angegeben") if param_def.nil?
5
+ throw RuntimeError.new("parameter definition existiert nicht") unless File.file?(param_def)
6
+
7
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
8
+ require 'setup_configuration'
9
+
10
+ # load file with parameter dsl
11
+ load param_def
12
+
13
+ # get reference to suite instance which holds parameter configuration
14
+ suite=SetupConfiguration::Suite.instance
15
+
16
+ #set output path
17
+ generator = SetupConfiguration::SuiteGenerator.new()
18
+ generator.output_path=File.dirname(param_def)
19
+
20
+ # load files with translations
21
+ SetupConfiguration::Translation.translation_files(suite.name).each() do |t|
22
+ trans_file=File.join(File.dirname(param_def), t)
23
+ if File.file?(trans_file)
24
+ SetupConfiguration::Translation::Translator.i18n_load_path(trans_file)
25
+ else
26
+ puts "WARNING: expected file with translations '#{trans_file}' not found."
27
+ end
28
+ end
29
+
30
+ generator.generate()
@@ -0,0 +1,105 @@
1
+ SetupConfiguration :underleaver do
2
+
3
+ category :common do
4
+ param :underleaver_config, 1
5
+ param :distance_photo_sensor, 2
6
+ param :distance_blade_to_sheet_drive, 3
7
+ param :distance_sheet_drive_to_sheet_exit, 4
8
+ param :time_for_cutting_unit, 5
9
+
10
+ param :paper_jam_detection_active, 6
11
+ param :paper_jam_detection_signal_length, 7 do
12
+ depends_on :paper_jam_detection_active
13
+ end
14
+ param :paper_jam_detection_check_time, 8 do
15
+ depends_on :paper_jam_detection_active
16
+ end
17
+
18
+ param :ext_enabling_following_unit, 10
19
+ param :ext_enabling_following_unit_method, 11 do
20
+ depends_on :ext_enabling_following_unit
21
+ end
22
+ param :ext_enabling_following_unit_delay, 12 do
23
+ depends_on :ext_enabling_following_unit
24
+ end
25
+
26
+ param :ext_enabling_previous_unit, 13
27
+ end
28
+
29
+ category :drives do
30
+
31
+ # paper roll drive
32
+ param :paper_roll_drive_config, 300
33
+ param :paper_roll_drive_distance_revolution, 301 do
34
+ depends_on :paper_roll_drive_config
35
+ end
36
+ param :paper_roll_drive_gear_in, 302 do
37
+ depends_on :paper_roll_drive_config
38
+ end
39
+ param :paper_roll_drive_gear_out, 303 do
40
+ depends_on :paper_roll_drive_config
41
+ end
42
+
43
+ # blade drive
44
+ param :blade_drive_config, 310
45
+ param :blade_drive_diameter, 311 do
46
+ depends_on :blade_drive_config
47
+ end
48
+ param :blade_drive_gear_in, 312 do
49
+ depends_on :blade_drive_config
50
+ end
51
+ param :blade_drive_gear_out, 313 do
52
+ depends_on :blade_drive_config
53
+ end
54
+
55
+ #paper feed drive
56
+ param :paper_feed_drive_config, 320
57
+ param :paper_feed_drive_distance_revolution, 321 do
58
+ depends_on :paper_feed_drive_config
59
+ end
60
+ param :paper_feed_drive_gear_in, 322 do
61
+ depends_on :paper_feed_drive_config
62
+ end
63
+ param :paper_feed_drive_gear_out, 323 do
64
+ depends_on :paper_feed_drive_config
65
+ end
66
+
67
+ #transport drive
68
+ param :transport_drive_config, 330
69
+ param :transport_drive_distance_revolution, 331 do
70
+ depends_on :transport_drive_config
71
+ end
72
+ param :transport_drive_gear_in, 332 do
73
+ depends_on :transport_drive_config
74
+ end
75
+ param :transport_drive_gear_out, 333 do
76
+ depends_on :transport_drive_config
77
+ end
78
+ param :transport_drive_belt_length, 334 do
79
+ depends_on :transport_drive_config
80
+ end
81
+
82
+ #infeed drive
83
+ param :infeed_drive_config, 350
84
+ param :infeed_drive_distance_revolution, 351 do
85
+ depends_on :infeed_drive_config
86
+ end
87
+ param :infeed_drive_gear_in, 352 do
88
+ depends_on :infeed_drive_config
89
+ end
90
+ param :infeed_drive_gear_out, 353 do
91
+ depends_on :infeed_drive_config
92
+ end
93
+ param :infeed_drive_belt_length, 354 do
94
+ depends_on :infeed_drive_config
95
+ end
96
+ end
97
+
98
+ setting do
99
+ min (0..0)
100
+ max (0..0)
101
+ balance_min (3000..3029)
102
+ balance_max (3030..3059)
103
+ end
104
+
105
+ end
@@ -0,0 +1,207 @@
1
+ de:
2
+ #Tabs aka categories
3
+ common:
4
+ name: "Allgemein"
5
+
6
+ drives:
7
+ name: "Antriebe Underleaver"
8
+
9
+ #parameter
10
+ underleaver_config:
11
+ name: "Underleaver virtuell=1 / real=0"
12
+ comment: "Einerstelle:\n
13
+ x0: Steuerung mit realen Achsen und Schutzhauben\n
14
+ x1: Steuerung simuliert alle nicht angew�hlten Achsen und Schutzhauben\n
15
+ \n
16
+ Zehnerstelle:\n
17
+ 0x: CanBus einschalten\n
18
+ 1x: CanBus ausschalten\n
19
+ \n
20
+ Hunderterstelle:\n
21
+ 1xx: Steuerung simuliert alle Antriebe"
22
+
23
+ distance_photo_sensor:
24
+ name: "Weg Lichtschranke bis Blattaustritt"
25
+ comment: ""
26
+
27
+ distance_blade_to_sheet_drive:
28
+ name: "Weg Schneide bis Blattantrieb"
29
+ comment: ""
30
+
31
+ distance_sheet_drive_to_sheet_exit:
32
+ name: "Weg Blattantrieb bis Blattaustritt"
33
+ comment: ""
34
+
35
+ time_for_cutting_unit:
36
+ name: "Zeit in der die Schneideeinrichtung oben sein muss [ms]"
37
+ comment: ""
38
+
39
+ paper_jam_detection_active:
40
+ name: "Papierstau�berwachung"
41
+ comment: "Erm�glicht die Abschaltung der Papierstau�berwachung\n
42
+ \n
43
+ 0=Abwahl\n
44
+ 1=Anwahl\n
45
+ \n
46
+ (Standard: 1)"
47
+
48
+ paper_jam_detection_signal_length:
49
+ name: "Signaldauer f�r Papierstau"
50
+ comment: "Zeitdauer, ab der ein durchg�ngiges Signal vom Papierstausensor als Papierstau interpretiert wird.\n
51
+ Die Angabe erfolgt in Millisekunden, d.h. 5000 entspricht 5 Sekunden.\n
52
+ Bei Angabe von 0 wird die Zeitdauer programmintern festgelegt."
53
+
54
+ paper_jam_detection_check_time:
55
+ name: "Papierstau�berpr�fungszeit nach 'letzem' Produkt"
56
+ comment: "Die �berpr�fung, ob ein Papierstau vorliegt, erfolgt bei Beginn der F�rderung des n�chsten Blattes.
57
+ Kommt nach dem aktuellen Produkt eine Weile kein Produkt mehr, so erm�glicht dieser Parameter die Einstellung
58
+ der Zeitdauer, nach deren Ablauf eine Papierstau�berpr�fung vorgenommen wird.\n
59
+ Steht der Wert auf 3000, wird 3 Sekunden nach der letzten Portion auf Papierstau �berpr�ft.\n
60
+ \n
61
+ Die Angabe erfolgt in Millisekunden, d.h. 3000 entspricht 3 Sekunden.\n
62
+ \n
63
+ Die Angabe wird 1:1 im Programm verwendet."
64
+
65
+ ext_enabling_following_unit:
66
+ name: "Externe Freigabe nachgelagerter Einheit (NE)"
67
+ comment: "An/Abwahl der externen Freigabe der nachgelagerten Einheit.\n
68
+ \n
69
+ 0: Der Underleaver arbeitet als 'Standalone'-Maschine oder besitzt innerhalb einer Linie keine nachgelagerte Einheit.\n
70
+ \n
71
+ 1: Der Underleaver besitzt eine nachgelagerte Einheit und soll auf dessen Freigaben reagieren."
72
+
73
+ ext_enabling_following_unit_method:
74
+ name: "Konfiguration der Freigabeart NE"
75
+ comment: "Konfiguration der externen Freigabe von der nachgelagerte Einheit.\n
76
+ \n
77
+ 0: Impuls - Freigabe wird durch einen Impuls umgeschalten (an->aus oder aus->an)\n
78
+ 1: negatives Dauersignal - Freigabe bei 0V\n
79
+ 2: positives Dauersignal - Freigabe bei 12V"
80
+
81
+ ext_enabling_following_unit_delay:
82
+ name: "Konfiguration der Verz�gerung NE"
83
+ comment: "Konfiguration der Verz�gerung nach Freigabesignal. [in ms]\n
84
+ \n
85
+ X: Der Wert X bestimmt die Zeit, die der Underleaver wartet nachdem das Freigabesignal empfangen wurde. Erst nach Ablauf dieser Zeit f�rdert der Underleaver weiter."
86
+
87
+ ext_enabling_previous_unit:
88
+ name: "Externe Freigabe an vorgelagerte Einheit (VE)"
89
+ comment: "Konfiguration der externen Freigabe an die vorgelagerte Einheit.\n
90
+ \n
91
+ 0: Impuls - Freigabe wird durch einen Impuls umgeschalten (an->aus oder aus->an)\n
92
+ 1: negatives Dauersignal - Freigabe bei 0V\n
93
+ 2: positives Dauersignal - Freigabe bei 12V"
94
+
95
+ paper_roll_drive_config:
96
+ name: "Bahnantrieb abgew�hlt=0/Servo=1/FU=2"
97
+ comment: &COMMON_DRIVE_CONFIG "Einerstelle: An/Abwahl\n
98
+ \n
99
+ XXX0: Achse im System nicht vorhanden ,wird vom System simuliert.\n
100
+ XXX1: Achse ist im Antriebssystem als Servoantrieb vorhanden.\n
101
+ XXX2: Achse ist im Antriebssystem als Frequenzumrichterantrieb vorhanden.\n
102
+ \n
103
+ Zehner- und Hunderterstelle: Motortyp\n
104
+ \n
105
+ X00X = NORD_MOTOR_037\n
106
+ X01X = NORD_MOTOR_075\n
107
+ X02X = LENZE_063C32\n
108
+ X03X = LENZE_047C22\n
109
+ X04X = LENZE_063C22\n
110
+ X05X = INTERROLL_TM111_037_2_081\n
111
+ X06X = INTERROLL_TM082_012_2_056\n
112
+ X07X = LENZE_063C22_GEBER\n
113
+ X08X = LENZE_063C22_POSI\n
114
+ X17X = INTERROLL_111_2P_037_133V\n
115
+ X18X = INTERROLL_111_2P_037_133V_GEBER\n
116
+ X19X = INTERROLL_111_2P_037_133V_POSI\n
117
+ X20X = INTERROLL_111_2P_037_133V_GEBER_AUF_C400\n
118
+ X21X = HARMONIC_DRIVE_FHA_11C_D200_GEBER\n
119
+ \n
120
+ Tausenderstelle:\n
121
+ \n
122
+ 0XXX = ohne PTC\n
123
+ 1XXX = mit PTC"
124
+
125
+ paper_roll_drive_distance_revolution:
126
+ name: "Bahnantrieb Weg/Umdrehung [mm]"
127
+ comment: ""
128
+
129
+ paper_roll_drive_gear_in:
130
+ name: "Bahnantrieb Getriebefaktor Z�hler"
131
+ comment: &COMMON_GEAR_IN "Anzahl der Getriebez�hne antriebseitig"
132
+
133
+ paper_roll_drive_gear_out:
134
+ name: "Bahnantrieb Getriebefaktor Nenner"
135
+ comment: &COMMON_GEAR_OUT "Anzahl der Getriebez�hne abtriebseitig"
136
+
137
+ blade_drive_config:
138
+ name: "Messerwelle abgew�hlt=0/Servo=1/FU=2"
139
+ comment: *COMMON_DRIVE_CONFIG
140
+
141
+ blade_drive_diameter:
142
+ name: "Messerwelle Durchmesser [mm]"
143
+ comment: ""
144
+
145
+ blade_drive_gear_in:
146
+ name: "Messerwelle Getriebefaktor Z�hler"
147
+ comment: *COMMON_GEAR_IN
148
+
149
+ blade_drive_gear_out:
150
+ name: "Messerwelle Getriebefaktor Nenner"
151
+ comment: *COMMON_GEAR_OUT
152
+
153
+ paper_feed_drive_config:
154
+ name: "Blattantrieb abgew�hlt=0/Servo=1/FU=2"
155
+ comment: *COMMON_DRIVE_CONFIG
156
+
157
+ paper_feed_drive_distance_revolution:
158
+ name: "Blattantrieb Weg/Umdrehung [mm]"
159
+ comment: ""
160
+
161
+ paper_feed_drive_gear_in:
162
+ name: "Blattantrieb Getriebefaktor Z�hler"
163
+ comment: *COMMON_GEAR_IN
164
+
165
+ paper_feed_drive_gear_out:
166
+ name: "Blattantrieb Getriebefaktor Nenner"
167
+ comment: *COMMON_GEAR_OUT
168
+
169
+ transport_drive_config:
170
+ name: "Portionsauflageband abgew�hlt=0/Servo=1/FU=2"
171
+ comment: *COMMON_DRIVE_CONFIG
172
+
173
+ transport_drive_distance_revolution:
174
+ name: "Portionsauflageband Weg/Umdrehung [mm]"
175
+ comment: ""
176
+
177
+ transport_drive_gear_in:
178
+ name: "Portionsauflageband Getriebefaktor Z�hler"
179
+ comment: *COMMON_GEAR_IN
180
+
181
+ transport_drive_gear_out:
182
+ name: "Portionsauflageband Getriebefaktor Nenner"
183
+ comment: *COMMON_GEAR_OUT
184
+
185
+ transport_drive_belt_length:
186
+ name: "Portionsauflageband Bandl�nge"
187
+ comment: "Gesamte Bandl�nge des Portionsauflagebandes.\nAngabe erfolgt in Millimeter."
188
+
189
+ infeed_drive_config:
190
+ name: "Einlegeband abgew�hlt=0/Servo=1/FU=2"
191
+ comment: *COMMON_DRIVE_CONFIG
192
+
193
+ infeed_drive_distance_revolution:
194
+ name: "Einlegeband Weg/Umdrehung [mm]"
195
+ comment: ""
196
+
197
+ infeed_drive_gear_in:
198
+ name: "Einlegeband Getriebefaktor Z�hler"
199
+ comment: *COMMON_GEAR_IN
200
+
201
+ infeed_drive_gear_out:
202
+ name: "Einlegeband Getriebefaktor Nenner"
203
+ comment: *COMMON_GEAR_OUT
204
+
205
+ infeed_drive_belt_length:
206
+ name: "Einlegeband Bandl�nge"
207
+ comment: "Gesamte Bandl�nge des Einlegebandes.\nAngabe erfolgt in Millimeter."