优化IMPORT
This commit is contained in:
parent
3ce29dcd2b
commit
a72344e7cc
@ -1,5 +1,7 @@
|
||||
use fltk::{prelude::*, window::Window, *};
|
||||
use fltk::{*, prelude::*};
|
||||
|
||||
use crate::services::ui_service::UiService;
|
||||
|
||||
mod services;
|
||||
mod models;
|
||||
mod ui;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub(crate) struct ConfigModel{
|
||||
pub current_line: usize,
|
||||
|
@ -1,5 +1,7 @@
|
||||
use std::fs;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::models::config_model::ConfigModel;
|
||||
|
||||
pub(crate) struct ConfigService;
|
||||
|
@ -1,7 +1,9 @@
|
||||
use std::fs::File;
|
||||
use std::io::BufReader;
|
||||
use calamine::{Reader, open_workbook, Xlsx, Data, DataType};
|
||||
|
||||
use anyhow::Result;
|
||||
use calamine::{Data, DataType, open_workbook, Reader, Xlsx};
|
||||
|
||||
use crate::models::work_model::WorkModel;
|
||||
|
||||
pub(crate) struct ExcelService {
|
||||
|
@ -1,7 +1,8 @@
|
||||
use log::{Record, Level, Metadata, SetLoggerError};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use chrono::Local;
|
||||
use lazy_static::lazy_static;
|
||||
use log::{Level, Metadata, Record, SetLoggerError};
|
||||
|
||||
type LogCallback = Box<dyn Fn(&str) + Send + Sync>;
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
use anyhow::Result;
|
||||
use serialport::*;
|
||||
use std::io::prelude::*;
|
||||
use std::thread::sleep;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Result;
|
||||
use serialport::*;
|
||||
|
||||
pub struct SerialService {
|
||||
port: Box<dyn SerialPort>,
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
use anyhow::Result;
|
||||
use crate::models::work_model::*;
|
||||
use rusqlite::{Connection};
|
||||
use chrono::Local;
|
||||
use rusqlite::Connection;
|
||||
|
||||
use crate::models::work_model::*;
|
||||
|
||||
pub(crate) struct SqliteService {
|
||||
conn: Connection,
|
||||
|
@ -2,13 +2,14 @@ use std::cell::RefCell;
|
||||
use std::process;
|
||||
use std::rc::Rc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use fltk::prelude::{DisplayExt, InputExt, WidgetBase, WidgetExt};
|
||||
use fltk::text::TextBuffer;
|
||||
|
||||
use crate::services::log_service::LOGGER;
|
||||
use crate::services::work_service::WorkService;
|
||||
use crate::ui::main_ui;
|
||||
use crate::ui::main_ui::*;
|
||||
use crate::services::log_service::LOGGER;
|
||||
|
||||
|
||||
pub(crate) struct UiService {
|
||||
ui: Rc<RefCell<UserInterface>>,
|
||||
|
@ -1,8 +1,9 @@
|
||||
use anyhow::Result;
|
||||
use log::Log;
|
||||
use crate::models::work_model::WorkModel;
|
||||
|
||||
use crate::models::config_model::ConfigModel;
|
||||
use crate::services::{serial_service::SerialService, sqlite_service::SqliteService, excel_service::ExcelService, config_service::ConfigService};
|
||||
use crate::models::work_model::WorkModel;
|
||||
use crate::services::{config_service::ConfigService, excel_service::ExcelService, serial_service::SerialService, sqlite_service::SqliteService};
|
||||
use crate::services::log_service::{FltkLogger, init_logger, LOGGER};
|
||||
|
||||
pub struct WorkService {
|
||||
|
Loading…
Reference in New Issue
Block a user