millworker 0.1.1 → 0.1.2
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.
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/bin/millworker +5 -5
- data/lib/millworker/version.rb +1 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/bin/millworker
CHANGED
@@ -36,7 +36,7 @@ end
|
|
36
36
|
|
37
37
|
def serial_port
|
38
38
|
return @serial_port unless @serial_port.nil?
|
39
|
-
@serial_port ||= SerialPort.new(SERIAL_PORT || config[:serial_port],{"baud" => 9600, "parity" => SerialPort::NONE
|
39
|
+
@serial_port ||= SerialPort.new(SERIAL_PORT || config[:serial_port],{"baud" => 9600, "parity" => SerialPort::NONE})
|
40
40
|
@serial_port.read_timeout = 1000
|
41
41
|
@serial_port
|
42
42
|
end
|
@@ -88,14 +88,14 @@ command :start do |c|
|
|
88
88
|
|
89
89
|
loop do
|
90
90
|
data = input.gets
|
91
|
-
next if data.nil? || data.empty?
|
91
|
+
next if data.nil? || data.empty? || data =~ /\u0003$/
|
92
92
|
|
93
93
|
# Take off newline from serial read
|
94
94
|
data.strip!
|
95
95
|
logger.info "received: '#{data.inspect}'"
|
96
96
|
|
97
|
-
# Take off start
|
98
|
-
rfid_id = data.slice(/\u0002(.*)
|
97
|
+
# Take off start of text unicode characters
|
98
|
+
rfid_id = data.slice(/\u0002(.*)/, 1)
|
99
99
|
next if rfid_id.nil?
|
100
100
|
|
101
101
|
# Read task list in every time so the daemon does not need to be
|
@@ -107,7 +107,7 @@ command :start do |c|
|
|
107
107
|
next
|
108
108
|
else
|
109
109
|
tasks.each do |task|
|
110
|
-
command = "#{task} #{
|
110
|
+
command = "#{task} #{rfid_id}"
|
111
111
|
|
112
112
|
execute(command) { |result|
|
113
113
|
logger.info("executed: '#{command}', result: #{result}")
|
data/lib/millworker/version.rb
CHANGED
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|