ladder_drive 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebbe6a801c62fb7bf390b50e904186de6c8a54d4
|
4
|
+
data.tar.gz: 65bc6883680145868f3bec1b333d76760fee2eb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a78ed56aecb16bb8a4bdf5275acdf6b5f551cc62bce2efd6512160e79aa5c0d9757eb9eed6419f419bb5eba4f13fcc44e6ead4d4b9cc6cdb4cb4277b8ad150b
|
7
|
+
data.tar.gz: 885041e935159cc775be45f6f8d0d46a148f74739c7b24fea1ccf8c4f4e5627f3be0b0b1cbbdd2fb92c6176defefadb949e55cf8e25848a76d10dde54c577f49
|
@@ -25,7 +25,7 @@ module LadderDrive
|
|
25
25
|
module Protocol
|
26
26
|
module Mitsubishi
|
27
27
|
|
28
|
-
class QDevice
|
28
|
+
class QDevice < PlcDevice
|
29
29
|
|
30
30
|
attr_reader :suffix, :number
|
31
31
|
|
@@ -49,11 +49,10 @@ module Mitsubishi
|
|
49
49
|
@suffix = [a[0,2].to_i(16), a[2,2].to_i(16)].pack "C*"
|
50
50
|
@suffix.strip!
|
51
51
|
@number = a[4,8].to_i(16)
|
52
|
-
elsif /(X|Y)(
|
52
|
+
elsif /(X|Y|B|W|SB|SW|DX|DY)([0-9a-f]+)/i =~ a
|
53
53
|
@suffix = $1.upcase
|
54
54
|
@number = $2.to_i(p_adic_number)
|
55
|
-
|
56
|
-
/(M|L|S|B|F|T|C|D|W|R|ZR)(.+)/i =~ a
|
55
|
+
elsif /(M|L|S|F|T|C|D|R|ZR)([0-9]+)/i =~ a
|
57
56
|
@suffix = $1.upcase
|
58
57
|
@number = $2.to_i(p_adic_number)
|
59
58
|
end
|
@@ -61,6 +60,10 @@ module Mitsubishi
|
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
63
|
+
def valid?
|
64
|
+
!!@suffix && !!@number
|
65
|
+
end
|
66
|
+
|
64
67
|
def p_adic_number
|
65
68
|
case @suffix
|
66
69
|
when "X", "Y", "B", "W", "SB", "SW", "DX", "DY"
|
data/lib/ladder_drive/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ladder_drive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katsuyoshi Ito
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|