tallakt-plcutil 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.rdoc +4 -0
- data/bin/awlls +6 -0
- data/lib/plcutil.rb +1 -1
- data/lib/plcutil/siemens/awl_ls_runner.rb +28 -0
- metadata +7 -3
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -20,6 +20,10 @@ Print the contents of Siemens Step 7 IO file
|
|
20
20
|
|
21
21
|
awlpp -s SYMLIST.DBF 00000007.AWL
|
22
22
|
|
23
|
+
Find file names corersponding to a internal Step 7 source file name
|
24
|
+
|
25
|
+
awlls --folder ../myproject/
|
26
|
+
|
23
27
|
Convert a siemens IO list into a Wonderware Intouch (non IAS) DB import file
|
24
28
|
|
25
29
|
s7tointouch -s SYMLIST.DBF -a SIEMENSPLC 00000007.AWL
|
data/bin/awlls
ADDED
data/lib/plcutil.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
require 'clamp'
|
3
|
+
require 'dbf'
|
4
|
+
module PlcUtil
|
5
|
+
class AwlLsRunner < Clamp::Command
|
6
|
+
def execute
|
7
|
+
# search for dbf file containing internal name -> awl file
|
8
|
+
dbf_files = Dir["#{folder || '.'}/**/S7CONTAI.DBF"]
|
9
|
+
if dbf_files.empty?
|
10
|
+
puts 'No S7CONTAI.DBF found in folder'
|
11
|
+
else
|
12
|
+
awl_to_siemens = dbf_files.map do |s7contai|
|
13
|
+
dbf = DBF::Table.new s7contai
|
14
|
+
dir = File::dirname s7contai
|
15
|
+
Hash[dbf.select {|x| x }.map {|row| [File.join(dir, row.filename), row.name]}]
|
16
|
+
end.reduce(&:merge)
|
17
|
+
|
18
|
+
expanded = file_list.map {|f| File::expand_path f }
|
19
|
+
interesting = awl_to_siemens.select {|k,v| expanded.member?(File.expand_path(k)) || file_list.member?(v) || file_list.empty? }
|
20
|
+
longest = interesting.values.sort {|a,b| a.length <=> b.length }.last
|
21
|
+
interesting.each {|k,v| puts "%-#{longest.length}s %s" % [v, k] }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
option %W(-f --folder), 'FOLDER', 'folder containing one or more Siemens Step 7 projects'
|
26
|
+
parameter "[FILE] ...", 'either siemens Step 7 names of source files, or AWL files to check'
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tallakt-plcutil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '2.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '2.0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: polyglot
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +81,7 @@ executables:
|
|
81
81
|
- awlpp
|
82
82
|
- intouchpp
|
83
83
|
- pl7tointouch
|
84
|
+
- awlls
|
84
85
|
extensions: []
|
85
86
|
extra_rdoc_files:
|
86
87
|
- LICENSE
|
@@ -95,6 +96,7 @@ files:
|
|
95
96
|
- lib/plcutil/siemens/awl/struct_type.rb
|
96
97
|
- lib/plcutil/siemens/awl/symlist_file.rb
|
97
98
|
- lib/plcutil/siemens/awl/treetop_nodes.rb
|
99
|
+
- lib/plcutil/siemens/awl_ls_runner.rb
|
98
100
|
- lib/plcutil/siemens/awl_pretty_print_runner.rb
|
99
101
|
- lib/plcutil/siemens/sdffile.rb
|
100
102
|
- lib/plcutil/siemens/step7_to_intouch_runner.rb
|
@@ -103,6 +105,7 @@ files:
|
|
103
105
|
- lib/plcutil/wonderware/intouch_pretty_print_runner.rb
|
104
106
|
- lib/plcutil/wonderware/standard_sections.yaml
|
105
107
|
- lib/plcutil.rb
|
108
|
+
- bin/awlls
|
106
109
|
- bin/awlpp
|
107
110
|
- bin/intouchpp
|
108
111
|
- bin/pl7tointouch
|
@@ -142,3 +145,4 @@ test_files:
|
|
142
145
|
- test/input_files/step7_v5.4/00000001.AWL
|
143
146
|
- test/input_files/step7_v5.4/S7_pro2.zip
|
144
147
|
- test/input_files/step7_v5.4/SYMLIST.DBF
|
148
|
+
has_rdoc:
|