tamashii-agent 0.2.6 → 0.2.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8472e90c77ca68d4a0d15db970fb273fb389062d
4
- data.tar.gz: db69d53412c00a2b54a31a3e6a6ea890c60e1492
3
+ metadata.gz: fcc65b8a798b3b32a4c0e4beb3f694a63b02e2f8
4
+ data.tar.gz: 3d35b65bd94bef0cf5a118d790c023e93d3a9eff
5
5
  SHA512:
6
- metadata.gz: b6a316a2e7a50933e92d8a98c2ef747f47d7c8b1b0d670f165367ee061f2fde511487adeffe5976b39e40f0b077e11262e2d4a0c697242e6c973024831e4675d
7
- data.tar.gz: 5d41b33314386e86365764565e64c6031248b29e6313bac7d251ccad4051b3aa3a1a07a9ddf93fac9ae3af3d69d2c8c838821c5ff5ff5f1168889d27704366ea
6
+ metadata.gz: 9ba2d2285b63a61ad5f7cb172bab5d4563ae7b55c71852eabcf61b66baeb56d668886a4f3e3b14536b8a3bfd5a735c7c08136c1ab57b6de9d955f0d975ef338a
7
+ data.tar.gz: 1f405b76004e0288cf7d5320e93f002e7ef136956dbdc59d2ef30f407fe544ecbf637fdaf4ff51ac2057535f4f49ae3b5dded32e9818afa2aa4af37df405ed4b
@@ -25,6 +25,7 @@ module Tamashii
25
25
  @line = line
26
26
  @text = ""
27
27
  @pos = -1
28
+ @stop_animation = false
28
29
  end
29
30
 
30
31
  def set_text(text)
@@ -48,6 +49,7 @@ module Tamashii
48
49
  def start_animation
49
50
  @pos = 0
50
51
  @max_pos = @text.size - @@line_width
52
+ @stop_animation = false
51
53
  logger.debug "Start animation for line #{@line}: #{@text}"
52
54
  @animation_thread = Thread.new { animation_loop }
53
55
  end
@@ -56,13 +58,18 @@ module Tamashii
56
58
  loop do
57
59
  sleep Config.lcd_animation_delay
58
60
  animation_show_text
61
+ break if @stop_animation
59
62
  sleep 1 if @pos == 0 || @pos == @max_pos
60
63
  end
61
64
  end
62
65
 
63
66
  def stop_animation
64
- @animation_thread.exit if @animation_thread
65
- @animation_thread = nil
67
+ @stop_animation = true
68
+ if @animation_thread
69
+ @animation_thread.join(1)
70
+ @animation_thread.exit
71
+ @animation_thread = nil
72
+ end
66
73
  end
67
74
 
68
75
  def print_text(text)
@@ -1,5 +1,5 @@
1
1
  module Tamashii
2
2
  module Agent
3
- VERSION = "0.2.6"
3
+ VERSION = "0.2.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tamashii-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - 蒼時弦也