@@ -2,13 +2,12 @@ use can_dbc::DBC;
2
2
use chrono:: Utc ;
3
3
#[ cfg( target_os = "windows" ) ]
4
4
use pcan_basic:: socket:: usb:: UsbCanSocket ;
5
- use slint:: { ComponentHandle , Model , ModelRc , SharedString , VecModel , Weak } ;
5
+ use slint:: { Model , ModelRc , SharedString , VecModel , Weak } ;
6
6
#[ cfg( target_os = "linux" ) ]
7
7
use socketcan:: { CanInterface , CanSocket , EmbeddedFrame , Frame , Socket } ;
8
8
use std:: {
9
9
collections:: HashMap ,
10
10
fmt:: Write ,
11
- process:: exit,
12
11
rc:: Rc ,
13
12
sync:: { mpsc:: Receiver , Arc , Mutex } ,
14
13
thread:: sleep,
@@ -30,13 +29,6 @@ static mut NEW_DBC_CHECK: bool = false;
30
29
use super :: { EVEN_COLOR , ODD_COLOR } ;
31
30
32
31
impl < ' a > ViewHandler < ' a > {
33
- pub fn check_to_kill_thread ( & self ) {
34
- let _ = self . ui_handle . upgrade_in_event_loop ( move |ui| {
35
- if !ui. window ( ) . is_visible ( ) {
36
- exit ( 1 ) ;
37
- }
38
- } ) ;
39
- }
40
32
pub fn process_can_messages ( & mut self ) {
41
33
if let Ok ( dbc) = self . mspc_rx . lock ( ) . unwrap ( ) . try_recv ( ) {
42
34
#[ cfg( target_os = "linux" ) ]
@@ -76,7 +68,6 @@ impl<'a> ViewHandler<'a> {
76
68
let mut start_bus_load = Instant :: now ( ) ;
77
69
let mut total_bits = 0 ;
78
70
loop {
79
- self . check_to_kill_thread ( ) ;
80
71
let bus_state = match can_if. state ( ) . unwrap ( ) . unwrap ( ) {
81
72
socketcan:: nl:: CanState :: ErrorActive => "ERR_ACTIVE" ,
82
73
socketcan:: nl:: CanState :: ErrorWarning => "ERR_WARNING" ,
0 commit comments