mod commands;
pub mod serial_core;
pub mod log;
use commands::serial::SerialConnectionState;

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .manage(SerialConnectionState::default())
        .plugin(tauri_plugin_opener::init())
        .invoke_handler(tauri::generate_handler![
            commands::file_explorer::file_explorer_list,
            commands::serial::serial_enum,
            commands::serial::serial_connect,
            commands::serial::serial_disconnect,
            commands::serial::serial_export_csv,
            commands::serial::serial_has_record_data,
            commands::serial::serial_export_csv_to_path,
            commands::serial::serial_import_csv,
            commands::serial::serial_import_csv_from_path,
            commands::calibration::serial_calibrate_with_coarse,
            commands::calibration::serial_calibrate_add_weight,
            commands::calibration::serial_calibrate_status,
            commands::window::win_minimize,
            commands::window::win_toggle_maximize,
            commands::window::win_close
        ])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
