Class: ErrorMsg

Inherits:
Object
  • Object
show all
Defined in:
lib/class/ErrorMsg.rb

Instance Method Summary collapse

Instance Method Details

#ascii_onlyObject



202
203
204
205
206
207
208
209
# File 'lib/class/ErrorMsg.rb', line 202

def ascii_only
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'String error',
    'Only ASCII characters can be specified'
  ).exec
  return false
end

#char_cell_valueObject



194
195
196
197
198
199
200
# File 'lib/class/ErrorMsg.rb', line 194

def char_cell_value
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Wrong data',
    'Wrong characters in this cell'
  ).exec
end

#concat_disallowObject



124
125
126
127
128
129
130
131
# File 'lib/class/ErrorMsg.rb', line 124

def concat_disallow
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Concatenation option',
    'This option can be used only with I2C bus commands'
  ).exec
  return false
end

#concat_nbrObject



115
116
117
118
119
120
121
122
# File 'lib/class/ErrorMsg.rb', line 115

def concat_nbr
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Wrong selection',
    'Select two commands in the table to concatenate them'
  ).exec
  return true
end

#filesize_errorObject



37
38
39
40
41
42
43
# File 'lib/class/ErrorMsg.rb', line 37

def filesize_error
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Error',
    'Dump error: The file size does not match with the given parameters'
  ).exec
end

#frequency_missingObject



222
223
224
225
226
227
228
229
# File 'lib/class/ErrorMsg.rb', line 222

def frequency_missing
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Missing settings',
    'Frequency setting missing'
  ).exec
  return false
end

#full_size_errorObject



240
241
242
243
244
245
246
247
# File 'lib/class/ErrorMsg.rb', line 240

def full_size_error
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Empty field',
    'Full size setting missing or equal 0'
  ).exec
  return false
end

#hardsploit_not_foundObject



3
4
5
6
7
8
9
10
# File 'lib/class/ErrorMsg.rb', line 3

def hardsploit_not_found
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Hardsploit Connectivity',
    'Hardsploit not detected. Please check the USB connection'
  ).exec
  return true
end

#hexa_cell_valueObject



186
187
188
189
190
191
192
# File 'lib/class/ErrorMsg.rb', line 186

def hexa_cell_value
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Wrong data',
    'Only hexadecimal values are accepted in this cell'
  ).exec
end

#highbyte_missingObject



142
143
144
145
146
147
148
149
# File 'lib/class/ErrorMsg.rb', line 142

def highbyte_missing
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Command error',
    'Payload size invalid or payload size (high) missing'
  ).exec
  return false
end

#i2c_cmd_too_longObject



169
170
171
172
173
174
175
176
# File 'lib/class/ErrorMsg.rb', line 169

def i2c_cmd_too_long
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'I2C command invalid',
    'Your payload is too big (> 2000)'
  ).exec
  return false
end

#i2c_errorObject



88
89
90
91
92
93
94
95
# File 'lib/class/ErrorMsg.rb', line 88

def i2c_error
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'I²C Action',
    'An error occured while processing the I²C command (I²C wrong speed)'
  ).exec
  return false
end

#inf_to_total_sizeObject



276
277
278
279
280
281
282
283
# File 'lib/class/ErrorMsg.rb', line 276

def inf_to_total_size
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Wrong value',
    'Start and stop address must be inforior to the chip total size'
  ).exec
  return false
end

#invalid_pin_nbrObject



29
30
31
32
33
34
35
# File 'lib/class/ErrorMsg.rb', line 29

def invalid_pin_nbr
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Invalid pin number value',
    'Pin number needs to be between 4 and 144'
  ).exec
end

#lowbyte_missingObject



133
134
135
136
137
138
139
140
# File 'lib/class/ErrorMsg.rb', line 133

def lowbyte_missing
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Command error',
    'Payload size invalid or payload size (low) missing'
  ).exec
  return false
end

#mode_missingObject



151
152
153
154
155
156
157
158
# File 'lib/class/ErrorMsg.rb', line 151

def mode_missing
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Command error',
    'Payload size invalid or Read / Write address missing'
  ).exec
  return false
end

#no_chip_loadedObject



20
21
22
23
24
25
26
27
# File 'lib/class/ErrorMsg.rb', line 20

def no_chip_loaded
  Qt::MessageBox.new(
    Qt::MessageBox::Information,
    "Wire chip",
    "You need to load a chip first"
  ).exec
  return true
end

#no_cmd_selectedObject

Commands



106
107
108
109
110
111
112
113
# File 'lib/class/ErrorMsg.rb', line 106

def no_cmd_selected
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Missing command',
    'Select a command in the array first'
  ).exec
  return true
end

#para_read_latencyObject



285
286
287
288
289
290
291
292
# File 'lib/class/ErrorMsg.rb', line 285

def para_read_latency
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Missing parallel settings',
    'Read latency setting missing'
  ).exec
  return false
end

#para_word_sizeObject



294
295
296
297
298
299
300
301
# File 'lib/class/ErrorMsg.rb', line 294

def para_word_size
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Missing parallel settings',
    'Word size setting missing'
  ).exec
  return false
end

#parallel_errorObject



97
98
99
100
101
102
103
# File 'lib/class/ErrorMsg.rb', line 97

def parallel_error
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Parallel Action',
    'An error occured while processing the parallel command'
  ).exec
end

#positive_cell_valueObject



178
179
180
181
182
183
184
# File 'lib/class/ErrorMsg.rb', line 178

def positive_cell_value
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Wrong data',
    'Only positive values are accepted in this cell'
  ).exec
end

#settings_missingObject

Global Settings



213
214
215
216
217
218
219
220
# File 'lib/class/ErrorMsg.rb', line 213

def settings_missing
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Missing settings',
    'No settings saved for this chip'
  ).exec
  return false
end

#size_neq_row_numberObject



160
161
162
163
164
165
166
167
# File 'lib/class/ErrorMsg.rb', line 160

def size_neq_row_number
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Command error',
    'The payload size does not match with the row number'
  ).exec
  return false
end

#spi_cmd_too_longObject



79
80
81
82
83
84
85
86
# File 'lib/class/ErrorMsg.rb', line 79

def spi_cmd_too_long
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'SPI command invalid',
    'SPI command size is to big (> 4000)'
    ).exec
    return false
end

#spi_errorObject



62
63
64
65
66
67
68
# File 'lib/class/ErrorMsg.rb', line 62

def spi_error
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'SPI Action',
    'An error occured while processing the SPI command'
  ).exec
end

#spi_mode_missingObject



70
71
72
73
74
75
76
77
# File 'lib/class/ErrorMsg.rb', line 70

def spi_mode_missing
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'SPI mode missing',
    'Mode setting is missing for this chip'
    ).exec
    return false
end

#start_inf_to_stopObject



267
268
269
270
271
272
273
274
# File 'lib/class/ErrorMsg.rb', line 267

def start_inf_to_stop
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Wrong value',
    'Start address must be inforior to the stop address'
  ).exec
  return false
end

#start_neq_stopObject



258
259
260
261
262
263
264
265
# File 'lib/class/ErrorMsg.rb', line 258

def start_neq_stop
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Wrong value',
    'Start address must not be equal to the stop address'
  ).exec
  return false
end

#start_stop_missingObject



249
250
251
252
253
254
255
256
# File 'lib/class/ErrorMsg.rb', line 249

def start_stop_missing
  Qt::MessageBox.new(
    Qt::MessageBox::Warning,
    'Empty field',
    'Start and stop address must be filled'
  ).exec
  return false
end

#swd_errorObject



53
54
55
56
57
58
59
60
# File 'lib/class/ErrorMsg.rb', line 53

def swd_error
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'SWD Action',
    'An error occured while processing the SWD scan'
  ).exec
  return false
end

#swd_not_foundObject



45
46
47
48
49
50
51
# File 'lib/class/ErrorMsg.rb', line 45

def swd_not_found
  Qt::MessageBox.new(
    Qt::MessageBox::Information,
    'SWD Action',
    'No return from the SWD'
  ).exec
end

#unknown(msg) ⇒ Object

Unknown



304
305
306
307
308
309
310
311
# File 'lib/class/ErrorMsg.rb', line 304

def unknown(msg)
  Logger.new($logFilePath).error(msg)
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Hardsploit unknown error',
    'An unknown error has been detected. Check the log for more details.'
  ).exec
end

#usb_errorObject



12
13
14
15
16
17
18
# File 'lib/class/ErrorMsg.rb', line 12

def usb_error
  Qt::MessageBox.new(
    Qt::MessageBox::Critical,
    'Hardsploit USB error',
    'USB error occured'
  ).exec
end