extface 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,4 +22,10 @@ daisy_fx1200:
22
22
  uuid: daisy_fx1200
23
23
  name: Daisy Fx1200
24
24
  extfaceable: one(Shop)
25
- driver: daisy_fx1200
25
+ driver: daisy_fx1200
26
+
27
+ posiflex_aura80:
28
+ uuid: posiflex_aura80
29
+ name: Posiflex Aura80
30
+ extfaceable: one(Shop)
31
+ driver: posiflex_aura80
@@ -13,4 +13,7 @@ datecs_fp550:
13
13
  type: Extface::Driver::Datecs::Fp550
14
14
 
15
15
  daisy_fx1200:
16
- type: Extface::Driver::DaisyFx1200
16
+ type: Extface::Driver::DaisyFx1200
17
+
18
+ posiflex_aura80:
19
+ type: Extface::Driver::Posiflex::Aura80
@@ -0,0 +1,64 @@
1
+ require 'test_helper'
2
+
3
+ module Extface
4
+ class Driver::Posiflex::Aura80Test < ActiveSupport::TestCase
5
+ setup do
6
+ @driver = extface_drivers(:posiflex_aura80)
7
+ @driver.flush # clear receive buffer
8
+ end
9
+
10
+ test "handle" do
11
+ assert_equal 1, @driver.handle("\x0C")
12
+ end
13
+
14
+ test "status" do
15
+ job = extface_jobs(:one)
16
+ job_thread = Thread.new do
17
+ @driver.set_job(job)
18
+ end
19
+ data = simulate_device_pull(job)
20
+ assert_equal data.b, @driver.class::Info::GET_PAPER_STATUS
21
+ @driver.handle("\x00")
22
+ job_thread.join
23
+ assert @driver.errors.empty?, @driver.errors.full_messages
24
+ end
25
+
26
+ test "paper out" do
27
+ job = extface_jobs(:one)
28
+ job_thread = Thread.new do
29
+ @driver.set_job(job)
30
+ end
31
+ data = simulate_device_pull(job)
32
+ assert_equal data.b, @driver.class::Info::GET_PAPER_STATUS
33
+ @driver.handle("\x0C")
34
+ job_thread.join
35
+ assert_equal @driver.errors.messages[:base], ["Paper out"]
36
+ end
37
+
38
+ test "autocut" do
39
+ job = extface_jobs(:one)
40
+ job_thread = Thread.new do
41
+ @driver.set_job(job)
42
+ @driver.autocut
43
+ end
44
+ simulate_device_pull(job) #status command
45
+ @driver.handle("\x00")
46
+ data = simulate_device_pull(job)
47
+ assert_equal data.b, @driver.class::Printer::PAPER_CUT
48
+ job_thread.join
49
+ end
50
+ end
51
+ end
52
+
53
+ # https://sourceforge.net/p/chromispos/discussion/help/thread/c004783b/2fc4/attachment/Aura%20Printer%20Command%20Manual.pdf
54
+ # Paper sensor status [n =1, 49]
55
+ # Bit Off/On Hex Decimal Status for ASB
56
+ # 0, Off 00 0 Paper roll near-end sensor: paper adequate.
57
+ # 1 On 03 3 Paper roll near-end sensor: paper near end.
58
+ # 2, Off 00 0 Paper out sensor: paper adequate.
59
+ # 3 On 0C 12 Paper out sensor: paper out.
60
+ # 4 Off 00 0 Not used Fixed to Off.
61
+ # 5,
62
+ # 6
63
+ # - - - Undefined.
64
+ # 7 Off 00 0 Not used Fixed to Off.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-28 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -110,8 +110,11 @@ files:
110
110
  - app/models/extface/driver/fidelio/fias.rb
111
111
  - app/models/extface/driver/generic_esc_pos.rb
112
112
  - app/models/extface/driver/generic_pos.rb
113
+ - app/models/extface/driver/posiflex/aura80.rb
114
+ - app/models/extface/driver/posiflex/aura_commands.rb
113
115
  - app/models/extface/driver/star_scp700.rb
114
116
  - app/models/extface/driver/star_tsp200.rb
117
+ - app/models/extface/driver/unknown/pos58.rb
115
118
  - app/models/extface/job.rb
116
119
  - app/models/extface/serial_config.rb
117
120
  - app/views/extface/application/_object_errors.html.erb
@@ -131,6 +134,8 @@ files:
131
134
  - app/views/extface/driver/fidelio/fias/_settings.html.erb
132
135
  - app/views/extface/driver/generic_esc_pos/_settings.html.erb
133
136
  - app/views/extface/driver/generic_pos/_settings.html.erb
137
+ - app/views/extface/driver/posiflex/aura80/_control.html.erb
138
+ - app/views/extface/driver/posiflex/aura80/_settings.html.erb
134
139
  - app/views/extface/driver/star_scp700/_settings.html.erb
135
140
  - app/views/extface/driver/star_tsp200/_settings.html.erb
136
141
  - app/views/extface/jobs/_form.html.erb
@@ -189,15 +194,20 @@ files:
189
194
  - test/dummy/config/initializers/wrap_parameters.rb
190
195
  - test/dummy/config/locales/en.yml
191
196
  - test/dummy/config/routes.rb
197
+ - test/dummy/db/development.sqlite3
192
198
  - test/dummy/db/migrate/20140221203517_create_shops.rb
193
199
  - test/dummy/db/schema.rb
194
200
  - test/dummy/db/test.sqlite3
201
+ - test/dummy/log/development.log
202
+ - test/dummy/log/extface/1033518405/aura80.log
195
203
  - test/dummy/log/extface/229906743/fp550.log
196
204
  - test/dummy/log/extface/229906743/fp550.log.20150519
197
205
  - test/dummy/log/extface/229906743/fp550.log.20150819
198
206
  - test/dummy/log/extface/229906743/fp550.log.20151218
207
+ - test/dummy/log/extface/229906743/fp550.log.20160829
199
208
  - test/dummy/log/extface/40760454/daisy_fx1200.log
200
209
  - test/dummy/log/extface/40760454/daisy_fx1200.log.20151219
210
+ - test/dummy/log/extface/40760454/daisy_fx1200.log.20160829
201
211
  - test/dummy/log/test.log
202
212
  - test/dummy/public/404.html
203
213
  - test/dummy/public/422.html
@@ -236,6 +246,7 @@ files:
236
246
  - test/models/extface/driver/daisy_fx1200_test.rb
237
247
  - test/models/extface/driver/datecs/fp550_test.rb
238
248
  - test/models/extface/driver/generic_pos_test.rb
249
+ - test/models/extface/driver/posiflex/aura80_test.rb
239
250
  - test/models/extface/driver/star_scp700_test.rb
240
251
  - test/models/extface/driver/star_tsp200_test.rb
241
252
  - test/models/extface/driver_test.rb
@@ -296,11 +307,16 @@ test_files:
296
307
  - test/dummy/config.ru
297
308
  - test/dummy/log/extface/40760454/daisy_fx1200.log
298
309
  - test/dummy/log/extface/40760454/daisy_fx1200.log.20151219
310
+ - test/dummy/log/extface/40760454/daisy_fx1200.log.20160829
311
+ - test/dummy/log/extface/1033518405/aura80.log
299
312
  - test/dummy/log/extface/229906743/fp550.log.20150819
300
313
  - test/dummy/log/extface/229906743/fp550.log.20150519
301
314
  - test/dummy/log/extface/229906743/fp550.log
302
315
  - test/dummy/log/extface/229906743/fp550.log.20151218
316
+ - test/dummy/log/extface/229906743/fp550.log.20160829
317
+ - test/dummy/log/development.log
303
318
  - test/dummy/log/test.log
319
+ - test/dummy/db/development.sqlite3
304
320
  - test/dummy/db/migrate/20140221203517_create_shops.rb
305
321
  - test/dummy/db/test.sqlite3
306
322
  - test/dummy/db/schema.rb
@@ -343,6 +359,7 @@ test_files:
343
359
  - test/models/extface/job_test.rb
344
360
  - test/models/extface/driver/generic_pos_test.rb
345
361
  - test/models/extface/driver/star_scp700_test.rb
362
+ - test/models/extface/driver/posiflex/aura80_test.rb
346
363
  - test/models/extface/driver/daisy_fx1200_test.rb
347
364
  - test/models/extface/driver/star_tsp200_test.rb
348
365
  - test/models/extface/driver/datecs/fp550_test.rb