Method: Parallel_export#control_export_result

Defined in:
lib/class/PARALLEL/Parallel_export.rb

#control_export_result(stop, time) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/class/PARALLEL/Parallel_export.rb', line 83

def control_export_result(stop, time)
  time = Time.new - time
  file_size = File.size("#{@filepath}")
  # 8 bits test
  if @chip_settings.parallel_word_size.zero?
    if (stop - @cw.lie_start.text.to_i + 1) == file_size
      Qt::MessageBox.new(Qt::MessageBox::Information, "Information", "Dump finished at #{((file_size / time)).round(2)}Bytes/s (#{(file_size)} Bytes in  #{time.round(4)} s)").exec
    else
      Qt::MessageBox.new(Qt::MessageBox::Critical, "Error", "Dump error: Size does not match").exec
    end
  else
    if (stop - @cw.lie_start.text.to_i + 1) == (file_size / 2)
      Qt::MessageBox.new(Qt::MessageBox::Information, "Information", "Dump finished at #{((file_size / time)).round(2)}Bytes/s (#{(file_size)} Bytes in  #{time.round(4)} s)").exec
    else
      Qt::MessageBox.new(Qt::MessageBox::Critical, "Error", "Dump error: File size and dump size does not match").exec
    end
  end
  p "DUMP #{((file_size/time)).round(2)}Bytes/s (#{(file_size)}Bytes in  #{time.round(4)} s)"
end