Code:
connect(acqthread,SIGNAL(new_packet_ready(packet*)),mode4controller,SLOT(recieve_new_packet(packet*)));
connect(acqthread,SIGNAL(display_critical_error(QString)),this,SLOT(recieve_critical_error_msg(QString)));
connect(acqthread,SIGNAL(new_packet_ready(packet*)),datalog_win,SLOT(recieve_new_packet(packet*)));
connect(acqthread,SIGNAL(update_pktrate(float)),datalog_win,SLOT(recieve_new_pktrate(float)));
connect(acqthread,SIGNAL(connection_state_changed(int)),datalog_win,SLOT(recieve_connection_state(int)));
connect(acqthread,SIGNAL(updated_ecm_info()),datalog_win,SLOT(recieve_new_ecm_info()));
connect(acqthread,SIGNAL(connection_state_changed(int)),this,SLOT(recieve_connection_state(int)));
connect(acqthread,SIGNAL(error_occurred()),this,SLOT(add_fail_count()));
connect(acqthread,SIGNAL(invalid_serial_port()),this,SLOT(recieve_invalid_serial_port()));
connect(acqthread,SIGNAL(new_cylbalance_result(int,int,float)),test_window,SLOT(display_cylbalance_result(int,int,float)));
connect(acqthread,SIGNAL(new_cylbalance_progress(QString,int)),test_window,SLOT(display_cylbalance_progress(QString,int)));
connect(acqthread,SIGNAL(flash_write_successful()),flash_launcher_win,SLOT(remember_previous_bin_write()));
connect(acqthread,SIGNAL(flash_read_successful()),flash_launcher_win,SLOT(save_read_bin()));
connect(acqthread,SIGNAL(end_flashprogress()),this,SLOT(hide_flash_progress()));
connect(acqthread,SIGNAL(start_flashprogress()),this,SLOT(show_flash_progress()));
connect(acqthread,SIGNAL(update_tside_progress(int)),flash_progress_win,SLOT(recieve_tside_progress(int)));
connect(acqthread,SIGNAL(update_eside_progress(int)),flash_progress_win,SLOT(recieve_eside_progress(int)));
connect(acqthread,SIGNAL(new_flash_message(QString)),flash_progress_win,SLOT(recieve_message(QString)));
connect(acqthread,SIGNAL(new_flash_divider(QString)),flash_progress_win,SLOT(recieve_divider(QString)));
connect(acqthread,SIGNAL(new_flash_error(QString)),flash_progress_win,SLOT(recieve_error_message(QString)));
connect(acqthread,SIGNAL(flash_error_occurred()),flash_progress_win,SLOT(error_occurred()));
connect(acqthread,SIGNAL(enable_flash_exit(bool)),flash_progress_win,SLOT(recieve_cancel_enable(bool)));
connect(acqthread,SIGNAL(update_flash_speed(float)),flash_progress_win,SLOT(recieve_flash_speed(float)));
connect(acqthread,SIGNAL(custom_log_append(QString)),raw_command_window,SLOT(new_custom_log_entry(QString)));
connect(acqthread,SIGNAL(connection_state_changed(int)),raw_command_window,SLOT(recieve_connection_state(int)));
connect(acqthread,SIGNAL(acq_event_display(QString)),this,SLOT(display_acqstatus(QString)));
connect(acqthread,SIGNAL(reset_error_count()),this,SLOT(reset_error_count()));
and between interfaces and the acqthread, a self-locking array of switches, integers, and other parameters...
Code:
class datastream_control : public QObject {
Q_OBJECT
public:
datastream_control();
safe_switch connection;
safe_switch quit;
//-------------
bool is_connected(); // is completely connected?
bool is_disconnected(); // is completely disconnected?
safe_int connection_state;
//-----------------
ecm_info_header info;
//-------------
safe_string port_name; // serial port string
//-------------
safe_switch mode1msg[8];
safe_switch mode1speedhack;
//-------------
safe_switch cyldroptest;
safe_switch blmcell_dump;
safe_switch clear_dtc;
safe_switch ecminfo;
//-------------
safe_switch set_vin;
safe_switch set_calid;
//-------------
safe_int throttle_ms;
//-------------
safe_raw_command custom_a;
safe_raw_command custom_b;
//-----------------
// Mode4 commands
safe_switch mode4send;
void m4_comm_init(); // zero entire mode4 string (disable all hacks)
void m4_comm_afr(byte afr); // command an AFR
void m4_drop_cyl(int cyl); // drop a cyl or 0 = dont drop
void m4_comm_idle(int rpm, int mode); // command an idle, mode 1=rpm 2=steps
void m4_comm_spark(int advance, int absolute); // command a spark, absolute =
int m4_get_spark();
void m4_force_blm(bool set, bool enable);
void m4_force_cl(bool set, bool enable);
void m4_reset_blm(bool set);
void m4_clear_blm_reset(); // this doesn't do an m4 update request for event loop use
void m4_force_gear(int gear); // commanded gear or 0=disable
void m4_fan(int n, bool set, bool enable); // mode::0=auto,1=on,2=off n::1=fan1 2=fan2
void m4_ccp(bool set, bool enable);
void m4_air(bool set, bool enable);
void m4_ac(bool set, bool enable);
void m4_tcc(bool set, bool enable);
void m4_actuator(int enable_byte, int enable_bit, int actuator_byte, int actuator_bit, bool set, bool enable);
QString m4_getpkt();
void m4_get_raw(byte *buf);
void m4_set_raw(byte *buf);
//-----------------
void reset();
safe_switch start_flash_write;
safe_switch start_flash_read;
safe_switch flash_exit;
safe_switch flash_tside;
safe_switch flash_eside;
safe_switch skip_unused_regions;
safe_switch enable_patches;
safe_switch dump_ram;
//-----------------
bin_file write_bin;
bin_file prev_bin;
bin_file read_bin;
private:
//-----------------
byte cylnum_to_m4ref(int cyl);
byte m4_process_afr(int afr);
//-----------------
QMutex m4_lock;
byte construct_mode4[16]; // mode4 buffer
};
Bookmarks