Repository navigation
Expand file tree
/
Copy pathcollclient.h
More file actions
107 lines (85 loc) · 3.23 KB
/
Copy pathcollclient.h
File metadata and controls
107 lines (85 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef COLLCLIENT_H
#define COLLCLIENT_H
#include <QTcpSocket>
#include "basic_c_fun/basic_surf_objs.h"
#include "neuron_editing/neuron_format_converter.h"
#include <iostream>
#include <QFile>
class CollServer;
class CollClient : public QTcpSocket
{
Q_OBJECT
struct DataType{
bool isFile=false;//false msg,true file
qint64 datasize=0;
};
struct segInfoUnit
{
segInfoUnit() { hierarchy = 0; }
long segID;
long head_tail;
long nodeCount;
bool refine;
int branchID, paBranchID;
int hierarchy;
};
public:
explicit CollClient(qintptr handle,CollServer* curServer,QObject *parent = nullptr);//初始化
~CollClient(){
std::cerr<<username.toStdString()+" is release\n";
}
void updateuserlist();//广播在线用户
void addseg(const QString msg);//加线
void addmanysegs(const QString msg); //加很多线
void delseg(const QString msg);//减线
void addmarkers(const QString msg);//加marker
void delmarkers(const QString msg);//删marker
void retypemarker(const QString msg);//marker改颜色
void connectseg(const QString msg);//连线
void retypesegment(const QString msg);//线改颜色
void splitseg(const QString msg);//break seg
void simpleConnectExecutor(V_NeuronSWC_list& segments, vector<segInfoUnit>& segInfo);
static QTimer timerforupdatemsg;//todo
//analyze
void analyzeSomaNearBy(const QString msg);//分析soma处是否连接至一点
void analyzeColorMutation(const QString msg);//分析是否存在颜色突变
void analyzeDissociativeSegs(const QString msg);//分析是否存在游离的线段
void analyzeAngles(const QString msg);//分析树突分叉的角度是否合理
//define soma
void defineSoma(const QString msg);//定义soma点
//get soma pos
void getSomaPos(const QString msg);//获取soma点的坐标
//消除quality_control marker
void removeQCMarker(QList<CellAPO>& markers);
public slots:
void sendmsgs(const QStringList &msgs);//发送消息
void ondisconnect();//连接断开
void onread();//读数据
void onError(QAbstractSocket::SocketError); //异常连接
void updatesendmsgcnt2processed();//将自动保存时已处理还未发送的消息发送
void sendmsgs2client(const int maxsize=0);//发送信息给客户端
void quit();
void disconnectByServer(CollClient* collclient);
private:
CollServer* myServer;
// SocketHelper* sockethelper;
void sendfiles(const QStringList &filenames);//发送文件
void preprocessmsgs(const QStringList &msgs);//处理消息
void receiveuser(const QString user, QString RES);//接收到用户登陆消息
void resetdatatype();//重置接收数据结构
DataType datatype;
QString username="";
int sendmsgcnt=0;
signals:
void removeList(QThread*);
void serverImediateSave(bool);
void exitNow();
void serverStartTimerForDetectLoops();
void serverStartTimerForDetectOthers();
void serverStartTimerForDetectWhole();
void serverStartTimerForDetectTip();
void serverStartTimerForDetectCrossing();
void serverStartTimerForHandleTip();
void detectUtilRemoveErrorSegs(bool);
};
#endif // COLLCLIENT_H