lib/ladder_drive/protocol/mitsubishi/qdevice.rb in ladder_drive-0.3.1 vs lib/ladder_drive/protocol/mitsubishi/qdevice.rb in ladder_drive-0.4.0

- old
+ new

@@ -44,27 +44,27 @@ if b @suffix = a.upcase @number = b else if a.length == 12 - @suffix = [a[0,2].to_i(16), a[2,2].to_i(16)].pack "c*" + @suffix = [a[0,2].to_i(16), a[2,2].to_i(16)].pack "C*" @suffix.strip! @number = a[4,8].to_i(16) elsif /(X|Y)(.+)/i =~ a @suffix = $1.upcase @number = $2.to_i(p_adic_number) else - /(M|L|S|B|F|T|C|D|W|R)(.+)/i =~ a + /(M|L|S|B|F|T|C|D|W|R|ZR)(.+)/i =~ a @suffix = $1.upcase @number = $2.to_i(p_adic_number) end end end end def p_adic_number case @suffix - when "X", "Y", "B", "W", "SB", "SW", "DX", "DY", "ZR" + when "X", "Y", "B", "W", "SB", "SW", "DX", "DY" 16 else 10 end end