evolis-premium_sdk 1.0.0 → 1.0.1

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: 5a24254811c654b6b0e7101dedeeafeaae18b621
4
- data.tar.gz: 243cd2662b01920e5acce05c1401ebbe7143affa
3
+ metadata.gz: 6f7fca049fe4c038f119c5acac7abf04755d9714
4
+ data.tar.gz: 438fc49476a3de63ca5de5ce500f4b4c7e50acc7
5
5
  SHA512:
6
- metadata.gz: ea377cdc59fd18f5338fb14c09503c3ac40775ca3a18ddadab6aae84edeb85a76d9d9123d55875f9b93083b5b7b3332850dc23d8c07eb21f09f4c35c54b02697
7
- data.tar.gz: f8fee0513e47bec357bf915e4011a39a2ea26c9ca6f0d938ab44da7f66879a76b8a97efb1007e9f66c506fbb06c15d5e3e4b27dde6e379d648e2b54e977c0241
6
+ metadata.gz: abe11bcc3a51a4bcf3d4121035b95593153867b97880fa8a2a7ab504edf42fe45f35540856c63aa9b4f396a8f095b6117725971b420ea9245e9852cd86f6912e
7
+ data.tar.gz: 45295b5d68861d65ac29e36254f1498656b029e103e1141667738192f1e89dcf543d4bc254c0ff3720b0c10f85af0be7d1f0b446f99322a955ac50bdf380819a
@@ -47,41 +47,146 @@ module Evolis
47
47
 
48
48
  # Settings and their values allowed to be used when getting and setting settings for print
49
49
  SETTINGS = {
50
- GDuplexMode: %w[SIMPLEX DUPLEX_CC DUPLEX_CM DUPLEX_MC DUPLEX_MM],
51
- GInputTray: %w[FEEDER AUTO MANUAL PRINTER],
52
- GOutputTray: %w[HOPPER REAR PRINTER],
53
- GRejectBox: %w[DEFAULTREJECT HOPPER PRINTER],
54
- GRibbonType: %w[RC_YMCKO RC_YMCKOS RC_YMCKOK RC_YMCKOKOS RM_KO RM_KBLACK RM_KWHITE RM_KRED RM_KGREEN RM_KBLUE RM_KSCRATCH RM_KMETALSILVER RM_KMETALGOLD RM_KSIGNATURE RM_KWAX RM_KPREMIUM RM_HOLO],
55
- GShortPanelManagement: %w[AUTO CUSTOM OFF],
56
- GSmoothing: %w[STDSMOOTH ADVSMOOTH NOSMOOTH],
57
- IGStrictPageSetup: %w[ON OFF],
58
- FBlackManagement: %w[NOBLACKPOINT ALLBLACKPOINT TEXTINBLACK],
59
- BBlackManagement: %w[NOBLACKPOINT ALLBLACKPOINT TEXTINBLACK],
60
- FColorBrightness: (1..20).to_a.map! { |i| "VAL#{i}" },
61
- BColorBrightness: (1..20).to_a.map! { |i| "VAL#{i}" },
62
- FColorContrast: (1..20).to_a.map! { |i| "VAL#{i}" },
63
- BColorContrast: (1..20).to_a.map! { |i| "VAL#{i}" },
64
- FHalftoning: %w[THRESHOLD FLOYD DITHERING CLUSTERED_DITHERING],
65
- BHalftoning: %w[THRESHOLD FLOYD DITHERING CLUSTERED_DITHERING],
66
- FMonochromeContrast: (1..20).to_a.map! { |i| "VAL#{i}" },
67
- BMonochromeContrast: (1..20).to_a.map! { |i| "VAL#{i}" },
68
- FOverlayContrast: (1..20).to_a.map! { |i| "VAL#{i}" },
69
- BOverlayContrast: (1..20).to_a.map! { |i| "VAL#{i}" },
70
- FOverlayManagement: %w[NOVARNISH FULLVARNISH BMPVARNISH],
71
- BOverlayManagement: %w[NOVARNISH FULLVARNISH BMPVARNISH],
72
- FPageRotate180: %w[ON OFF],
73
- BPageRotate180: %w[ON OFF],
74
- GMagCoercivity: %w[OFF LOCO HICO],
75
- GMagT1Encoding: %w[ISO1 ISO2 ISO3 SIPASS C2 JIS2 C4 NONE],
76
- GMagT2Encoding: %w[ISO1 ISO2 ISO3 SIPASS C2 JIS2 C4 NONE],
77
- GMagT3Encoding: %w[ISO1 ISO2 ISO3 SIPASS C2 JIS2 C4 NONE],
78
- Track1Data: String,
79
- Track2Data: String,
80
- Track3Data: String,
81
- Resolution: %w[DPI300 DPI600300 DPI1200300],
82
- IShortPanelShift: /^[0-9]+$/,
83
- Passthrough: String,
84
- RawData: String,
50
+ GDuplexMode: {
51
+ validation: %w[SIMPLEX DUPLEX_CC DUPLEX_CM DUPLEX_MC DUPLEX_MM],
52
+ description: 'Front side and Back side settings'
53
+ },
54
+ GInputTray: {
55
+ validation: %w[FEEDER AUTO MANUAL PRINTER],
56
+ description: 'Card insertion'
57
+ },
58
+ GOutputTray: {
59
+ validation: %w[HOPPER REAR PRINTER],
60
+ description: 'Card exit'
61
+ },
62
+ GRejectBox: {
63
+ validation: %w[DEFAULTREJECT HOPPER PRINTER],
64
+ description: 'Rejected error card'
65
+ },
66
+ GRibbonType: {
67
+ validation: %w[RC_YMCKO RC_YMCKOS RC_YMCKOK RC_YMCKOKOS RM_KO RM_KBLACK RM_KWHITE RM_KRED RM_KGREEN RM_KBLUE RM_KSCRATCH RM_KMETALSILVER RM_KMETALGOLD RM_KSIGNATURE RM_KWAX RM_KPREMIUM RM_HOLO],
68
+ description: 'Ribbon type'
69
+ },
70
+ GShortPanelManagement: {
71
+ validation: %w[AUTO CUSTOM OFF],
72
+ description: 'Short panel management mode'
73
+ },
74
+ GSmoothing: {
75
+ validation: %w[STDSMOOTH ADVSMOOTH NOSMOOTH],
76
+ description: 'Smoothing mode'
77
+ },
78
+ IGStrictPageSetup: {
79
+ validation: %w[ON OFF],
80
+ description: 'Strict page setup mode'
81
+ },
82
+ FBlackManagement: {
83
+ validation: %w[NOBLACKPOINT ALLBLACKPOINT TEXTINBLACK],
84
+ description: 'Black panel management mode (front)'
85
+ },
86
+ BBlackManagement: {
87
+ validation: %w[NOBLACKPOINT ALLBLACKPOINT TEXTINBLACK],
88
+ description: 'Black panel management mode (back)'
89
+ },
90
+ FColorBrightness: {
91
+ validation: (1..20).to_a.map! { |i| "VAL#{i}" },
92
+ description: 'Brightness adjustment for color panel (front)'
93
+ },
94
+ BColorBrightness: {
95
+ validation: (1..20).to_a.map! { |i| "VAL#{i}" },
96
+ description: 'Brightness adjustment for color panel (back)'
97
+ },
98
+ FColorContrast: {
99
+ validation: (1..20).to_a.map! { |i| "VAL#{i}" },
100
+ description: 'Contrast adjustment for color panel (front)'
101
+ },
102
+ BColorContrast: {
103
+ validation: (1..20).to_a.map! { |i| "VAL#{i}" },
104
+ description: 'Contrast adjustment for color panel (back)'
105
+ },
106
+ FHalftoning: {
107
+ validation: %w[THRESHOLD FLOYD DITHERING CLUSTERED_DITHERING],
108
+ description: 'Black panel adjustment (front)'
109
+ },
110
+ BHalftoning: {
111
+ validation: %w[THRESHOLD FLOYD DITHERING CLUSTERED_DITHERING],
112
+ description: 'Black panel adjustment (back)'
113
+ },
114
+ FMonochromeContrast: {
115
+ validation: (1..20).to_a.map! { |i| "VAL#{i}" },
116
+ description: 'Monochrome resin adjustment (front)'
117
+ },
118
+ BMonochromeContrast: {
119
+ validation: (1..20).to_a.map! { |i| "VAL#{i}" },
120
+ description: 'Monochrome resin adjustment (back)'
121
+ },
122
+ FOverlayContrast: {
123
+ validation: (1..20).to_a.map! { |i| "VAL#{i}" },
124
+ description: 'Varnish adjustment (front)'
125
+ },
126
+ BOverlayContrast: {
127
+ validation: (1..20).to_a.map! { |i| "VAL#{i}" },
128
+ description: 'Varnish adjustment (back)'
129
+ },
130
+ FOverlayManagement: {
131
+ validation: %w[NOVARNISH FULLVARNISH BMPVARNISH],
132
+ description: 'Varnish type (front)'
133
+ },
134
+ BOverlayManagement: {
135
+ validation: %w[NOVARNISH FULLVARNISH BMPVARNISH],
136
+ description: 'Varnish type (back)'
137
+ },
138
+ FPageRotate180: {
139
+ validation: %w[ON OFF],
140
+ description: 'Rotate by 180° (front)'
141
+ },
142
+ BPageRotate180: {
143
+ validation: %w[ON OFF],
144
+ description: 'Rotate by 180° (back)'
145
+ },
146
+ GMagCoercivity: {
147
+ validation: %w[OFF LOCO HICO],
148
+ description: 'Magnetic coercivity'
149
+ },
150
+ GMagT1Encoding: {
151
+ validation: %w[ISO1 ISO2 ISO3 SIPASS C2 JIS2 C4 NONE],
152
+ description: 'Magnetic Track 1 mode'
153
+ },
154
+ GMagT2Encoding: {
155
+ validation: %w[ISO1 ISO2 ISO3 SIPASS C2 JIS2 C4 NONE],
156
+ description: 'Magnetic Track 2 mode'
157
+ },
158
+ GMagT3Encoding: {
159
+ validation: %w[ISO1 ISO2 ISO3 SIPASS C2 JIS2 C4 NONE],
160
+ description: 'Magnetic Track 3 mode'
161
+ },
162
+ Track1Data: {
163
+ validation: String,
164
+ description: 'Magnetic track 1 data'
165
+ },
166
+ Track2Data: {
167
+ validation: String,
168
+ description: 'Magnetic track 2 data'
169
+ },
170
+ Track3Data: {
171
+ validation: String,
172
+ description: 'Magnetic track 3 data'
173
+ },
174
+ Resolution: {
175
+ validation: %w[DPI300 DPI600300 DPI1200300],
176
+ description: 'Resolution'
177
+ },
178
+ IShortPanelShift: {
179
+ validation: /^[0-9]+$/,
180
+ description: 'Short panel management shift'
181
+ },
182
+ Passthrough: {
183
+ validation: String,
184
+ description: 'Passthrough/Raw data'
185
+ },
186
+ RawData: {
187
+ validation: String,
188
+ description: 'Passthrough/Raw data'
189
+ }
85
190
  }
86
191
 
87
192
  # Checks if settings supplied are valid
@@ -107,15 +212,27 @@ module Evolis
107
212
  unless key_only
108
213
  return false if !value
109
214
  return false if value.is_a?(String) && value.empty?
110
- return false if SETTINGS[setting.to_sym].is_a?(Array) && !SETTINGS[setting.to_sym].include?(value)
111
- return false if SETTINGS[setting.to_sym].is_a?(Class) && !value.is_a?(SETTINGS[setting.to_sym])
112
- return false if SETTINGS[setting.to_sym].is_a?(Regexp) && value.is_a?(String) && value !~ SETTINGS[setting.to_sym]
215
+ return false if SETTINGS[setting.to_sym][:validation].is_a?(Array) && !SETTINGS[setting.to_sym][:validation].include?(value)
216
+ return false if SETTINGS[setting.to_sym][:validation].is_a?(Class) && !value.is_a?(SETTINGS[setting.to_sym][:validation])
217
+ return false if SETTINGS[setting.to_sym][:validation].is_a?(Regexp) && value.is_a?(String) && value !~ SETTINGS[setting.to_sym][:validation]
113
218
  end
114
219
 
115
220
  return true
116
221
  end
117
222
  end
118
223
 
224
+ # @return [String] string of description or false if setting does not exist
225
+ # @raise [Error::InvalidPrintSettingError] on invalid print setting
226
+ def print_setting(setting)
227
+ return SETTINGS[setting.to_sym][:description] if SETTINGS.has_key?(setting.to_sym)
228
+ raise Error::InvalidPrintSettingError.new setting
229
+ end
230
+
231
+ # @return [Hash] of settings with descriptions
232
+ def list_settings
233
+ return SETTINGS.map{ |key, value| [key, value[:description]] }.to_h
234
+ end
235
+
119
236
  # Basic checking for valid base64 string, as used in the SDK
120
237
  #
121
238
  # @param string [String] the base64 encoded data
@@ -1,5 +1,5 @@
1
1
  module Evolis
2
2
  module PremiumSdk
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evolis-premium_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boye Holden
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-23 00:00:00.000000000 Z
11
+ date: 2017-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.6.11
121
+ rubygems_version: 2.5.2
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Implements Evolis Premium SDK.