Method: I2c_export#select_export_file

Defined in:
lib/class/I2C/I2c_export.rb

#select_export_fileObject



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/class/I2C/I2c_export.rb', line 27

def select_export_file
  @filepath = Qt::FileDialog.getSaveFileName(self, tr('Select a file'), '/', tr('Bin file (*.bin)'))
  unless @filepath.nil?
    $file = File.open("#{@filepath}", 'w')
    @i2c_export_gui.btn_export.setEnabled(true)
    @i2c_export_gui.btn_full_export.setEnabled(true)
  end
rescue Exception => msg
    logger = Logger.new($logFilePath)
    logger.error msg
    Qt::MessageBox.new(Qt::MessageBox::Critical, 'Critical error', 'Error occured while openning the export file. Consult the logs for more details').exec
end