main.cpp

来自「嵌入式LINUX的智能家居系统源码」· C++ 代码 · 共 57 行

CPP
57
字号
#include"can.h"#include"cmd.h"#include"BT_ser.h"#include"sql.h"#include<qapplication.h>#include"home_terminel_form.h"int main(int argc,char ** argv){	QApplication app(argc,argv);	Can can;	can.init();	ker_cmd cmd;		home_terminel_Form w;		BT_ser bt;	sql s;	s.link_db();	s.changeTBL();       //connect can and cmd first from can to cmd, and then from cmd to can	app.connect(&can,SIGNAL(sig_cmd(int)),&cmd,SLOT(center_cmd_proxy(int)));	app.connect(&cmd,SIGNAL(sig_cmd_home(int,char)),&can,SLOT(write_cmd(int,char)));	app.connect(&cmd,SIGNAL(sig_cmd_door(int,char)),&can,SLOT(write_cmd(int,char)));//connect window and cmd	app.connect(&w,SIGNAL(sig_cmd(int)),&cmd,SLOT(ker_cmd_proxy(int)));	app.connect(&cmd,SIGNAL(sig_cmd_local_ui(int)),&w,SLOT(switcher(int)));//connect BT and window	app.connect( &w, SIGNAL( sig_cmd(int) ), &bt, SLOT( write_BT(int) ) );    	app.connect( &bt, SIGNAL( sig_cmd(int) ), &w, SLOT( switcher(int) ) );//connect BT and cmd	app.connect( &bt, SIGNAL( sig_cmd(int ) ), &cmd, SLOT( ker_cmd_proxy(int)));	app.connect( &cmd, SIGNAL( sig_cmd_local_bt(int) ), &bt, SLOT( switcher(int )));	app.connect( &cmd, SIGNAL( sig_cmd_pda(int ) ), &bt, SLOT( write_BT(int )));//connect sql and window	app.connect( &w, SIGNAL( sig_get_log(char *) ), &s, SLOT( request_db(char * )));	app.connect( &s, SIGNAL( sig_log(char *,int ) ), &w, SLOT( treatLog(char *,int )));//connect sql and center cmd	app.connect( &cmd,SIGNAL(sig_log(int)),&s,SLOT(logger(int)));	//connect app and window	app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );	w.show();	w.getenviron();	bt.init();	return (app.exec());}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?