plc_access 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/plc_access/protocol/keyence/kv_device.rb +2 -0
- data/lib/plc_access/protocol/mitsubishi/qdevice.rb +1 -0
- data/lib/plc_access/protocol/omron/omron_device.rb +1 -0
- data/lib/plc_access/protocol/plc_device.rb +2 -2
- data/lib/plc_access/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 64e62d7a3897342a72e3a3e93a95eabf0df0b4362d81454cf5d86842dc74a754
|
|
4
|
+
data.tar.gz: 890d303add93fe36f6f77ac48db506d4105e5379a883c491814bb97eb0691d8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9ad8b4663e0980bfe8c10e37fc4a8221934e6d612c738ed2a3fe5c1a43492db3dc99371e5f75c399442d89255f6282ae6aaddd7a967a6bc7858cbe76f0b2efb
|
|
7
|
+
data.tar.gz: 05511e4e58e042681e64b5f69a98f04eed22d2738e96c217032a5b92c9cada9078aa87eeaa046639a15553ca3fc8434f673de35774aa73a6ae631427cbbb7293
|
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
plc_access (0.2.
|
|
4
|
+
plc_access (0.2.3)
|
|
5
5
|
serialport (~> 1.3, >= 1.3.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
ast (2.4.2)
|
|
11
|
-
json (2.
|
|
11
|
+
json (2.21.2)
|
|
12
12
|
language_server-protocol (3.17.0.4)
|
|
13
13
|
lint_roller (1.1.0)
|
|
14
14
|
parallel (1.26.3)
|
|
@@ -30,6 +30,7 @@ module PlcAccess
|
|
|
30
30
|
def initialize(a, b = nil)
|
|
31
31
|
super
|
|
32
32
|
@suffix = 'R' if @suffix.nil? || @suffix.length.zero?
|
|
33
|
+
raise ArgumentError, "Invalid device suffix: #{@suffix}" unless ESC_SUFFIXES.include?(@suffix)
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
def +(other)
|
|
@@ -46,6 +47,7 @@ module PlcAccess
|
|
|
46
47
|
SUFFIXES_FOR_DEC_HEX = %w[R MR LR CR].freeze
|
|
47
48
|
SUFFIXES_FOR_HEX = %w[B VB W].freeze
|
|
48
49
|
SUFFIXES_FOR_BIT = %w[R B MR LR CR VB].freeze
|
|
50
|
+
ESC_SUFFIXES = (SUFFIXES_FOR_DEC + SUFFIXES_FOR_DEC_HEX + SUFFIXES_FOR_HEX + SUFFIXES_FOR_BIT).uniq.freeze
|
|
49
51
|
|
|
50
52
|
def suffixes_for_dec
|
|
51
53
|
SUFFIXES_FOR_DEC
|
|
@@ -52,6 +52,7 @@ module PlcAccess
|
|
|
52
52
|
@bit = ::Regexp.last_match(4).to_i if ::Regexp.last_match(4)
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
|
+
raise ArgumentError, "Invalid device suffix: #{@suffix}" if @suffix && !SUFFIXES.include?(@suffix)
|
|
55
56
|
case @suffix
|
|
56
57
|
when 'T', 'C'
|
|
57
58
|
raise "#{name} is not allowed as a bit device." if @bit
|
|
@@ -53,7 +53,7 @@ module PlcAccess
|
|
|
53
53
|
@value = 0
|
|
54
54
|
case a
|
|
55
55
|
when Integer
|
|
56
|
-
@suffix = ESC_SUFFIXES[a]
|
|
56
|
+
@suffix = self.class::ESC_SUFFIXES[a]
|
|
57
57
|
@number = b
|
|
58
58
|
when String, Symbol
|
|
59
59
|
a = a.to_s # convert to string if it's a symbol
|
|
@@ -181,7 +181,7 @@ module PlcAccess
|
|
|
181
181
|
end
|
|
182
182
|
|
|
183
183
|
def device_code
|
|
184
|
-
ESC_SUFFIXES.index @suffix
|
|
184
|
+
self.class::ESC_SUFFIXES.index @suffix
|
|
185
185
|
end
|
|
186
186
|
|
|
187
187
|
def reset
|
data/lib/plc_access/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: plc_access
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Katsuyoshi Ito
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-08-29 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: serialport
|