From 0e50aaa7da39851414cdbbb40d4f607592305624 Mon Sep 17 00:00:00 2001 From: lsy2246 Date: Mon, 15 Apr 2024 01:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=99=E5=A5=BD=E8=8F=9C=E5=8D=95,=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E7=9A=84=E8=81=94=E7=B3=BB=E4=BA=BA=E5=86=99=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E5=8D=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cilent/__pycache__/Login.cpython-312.pyc | Bin 14191 -> 0 bytes .../Session_server.cpython-312.pyc | Bin 3887 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 3980 -> 0 bytes python/test/Client/Chat_main.py | 103 ++++++++++++++++++ python/test/{Cilent => Client}/Login.py | 0 .../test/{Cilent => Client}/Session_server.py | 1 + python/test/{Cilent => Client}/__init__.py | 23 ++-- python/test/Client/image/chat.png | Bin 0 -> 2391 bytes python/test/Client/image/connect.png | Bin 0 -> 2713 bytes python/test/Client/image/find.png | Bin 0 -> 1994 bytes python/test/Client/image/site.png | Bin 0 -> 4257 bytes python/test/StartClient.py | 2 +- python/test/test.py | 48 ++++---- python/test/test2.py | 43 ++++++++ python/test/test_plan.py | 9 ++ 15 files changed, 199 insertions(+), 30 deletions(-) delete mode 100644 python/test/Cilent/__pycache__/Login.cpython-312.pyc delete mode 100644 python/test/Cilent/__pycache__/Session_server.cpython-312.pyc delete mode 100644 python/test/Cilent/__pycache__/__init__.cpython-312.pyc create mode 100644 python/test/Client/Chat_main.py rename python/test/{Cilent => Client}/Login.py (100%) rename python/test/{Cilent => Client}/Session_server.py (99%) rename python/test/{Cilent => Client}/__init__.py (66%) create mode 100644 python/test/Client/image/chat.png create mode 100644 python/test/Client/image/connect.png create mode 100644 python/test/Client/image/find.png create mode 100644 python/test/Client/image/site.png create mode 100644 python/test/test2.py create mode 100644 python/test/test_plan.py diff --git a/python/test/Cilent/__pycache__/Login.cpython-312.pyc b/python/test/Cilent/__pycache__/Login.cpython-312.pyc deleted file mode 100644 index 2e1e5c03f455e77ae5c8ae14db0b5c6122efc3f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14191 zcmeHNdr%bTmhTy6plA3{AU;4u0eKAr3TjNmS9lDM@X!E0c<3k=BBo4?SikrKIeSrobP<6zsGO-zY-Gc6kK;~>w1`ciu!MSP%dk@@?8~F#wdnj zOubZ_d^fe3q-S%R*-TYajQMqniSbhYSf#OczZN6c+blyShh+&L8oM<%MX7d919gn@ zQmDJl%$Q!M+G0?1n}vyi(#lw%jFs$J!CtI4&Y!4PB-d4YHc2uLB*{(;#Yd3QYdOziWy_pwKRwm6EkJG7N(o1 zpz47i?MGeL!p~<-Iyq@1BL!7C^RUUE5Xr-*VKZaC7Vbra&E<5(=xnZdSf^rhm~yM0 z|Kt`nMc;6Yp}&;Th%;8L4?o&2S<$TBnOI#rk` zoU=8)QX5vaf`3nGRKG*1Yj<5n7id(a23}_!kQ-{og1tSOgi?#hqm3HXU#8TxdxWf->7ch%lTm7Zmr~R2Ah}n2QfkZ! zU0>hJU22jdPCi_6Ut7^EC|qWR_1qE%YUMcVE5_4$Hsx45#> z+v6GR4IbzZ_=3LvJ~6Jr+c#M5VMPm8#MrWd0dF6;+UR|`mJ#Dw?{Qxs=w;pDenP+- zbO*fbOY)<=*&9?EudHCbo}jlm=m`!6P@6ph0mKq=96)nvt`d=1lh?Zo_VTG~x_V$Q0 zIw=LnE*p@Xww>x{yGT@4NZZfRqqIP$a&+pY>?@XuRo9Q) z+A35Wa}Cl7pgDTj@TB{(%*gd^0RN3j#zj)Wifr@yGJe`dAkjt)-BLU0-eIqDVJ6W zsSYmHF|n7YOCzXGF4Y+-0`fk^hV9C;JYDz|O(csnPiKA;OQmfT)@|n2ZJu~>eqG6k z<&BjK=~!ELJ;vGH`JrZIx=;q@1Ny_3t{2{DnKYroL` zUh>tn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)5Ibx(Z9Shn PmU1EGd-#yRB-{F5@}U6E diff --git a/python/test/Cilent/__pycache__/Session_server.cpython-312.pyc b/python/test/Cilent/__pycache__/Session_server.cpython-312.pyc deleted file mode 100644 index f5bbde4f4c84e6d6ae6139ad4be81c321d10ae73..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3887 zcmb7`T}&I<6@c$}X8eP(abhQNAb@c&#&LkaCR#!hHv9zIL}9ZDQVT+wTAqQm*VydL zKo$gOSBk1Upe-w9#YU>OyARc7MWkfas)*l+_pdHj8G)izRF2j-2>Azg%);awo9)n8B0S-#6d5*ZYM9dd zmSKxt)5Eld^b_84negC2xE|XyzZ45I! z4U**5C7U@9x^A<*RVR0CwawOYzCn@K zetoyOW~<)z^}?Q~NrWAkakRF**?a{4S`(*g3F(VanpKX8V}cxUY7QwAe@_s(#DwO| zHzzWpthtQS<@B+lt{jsmCCwqfD+)0_ksi~mgL+eQrV{D*@^_-`F6wZ31y+KO%9>jg z;zD9dFje<#@8`8)kBlUwMkPGcz>C)2juAd4$425AUKp8}mfy{!M`S^gM|u(|AuW$= z_lf3-Y0b`YiF88dxS4$=ljejSOiKcY4@qu+{S{`xovW(7!es6KTy-7RmAUGmUOx&( z)nJdKn z=$$LfLwj%&FKe5#qLZM@ZPtJrE)fSfWD=E1iu5VHLP3gyN<3!T5eW< zUH!YM+wTg&4?OA`v`W{l@eg14O@z-q-%dVrj zNVEQ#HQ)ZvT5j~*qL%xV$~M*ahT?nUKkF=Lypa6xt8RB6?5QH(RXKXg>F?@mdTsQ5 z8w>4tA|hR9ZYybxA1V~I335gQY@yxvS*>1n^D zauB{Fu^`~k?d9SgXzd(_M#00DUJ-@F_x1Qx`a{505>1yBzTn}>LMq%+*@{?m)N7Jm z!Oomz*22?>BhO5Mrvk6&Y$av3C??2-_)q^#OSELpurr|1p=R*9^d8W6l@T`pP ztCv~Yq;@;OycOb}sbug>&(jM(0-m8R;@LKkAaMUL*hzV`sa<2ogtRC`ERz_$pZxav z<6kW3&3|6|!{a}GsxuG3Ke_t*Jo9~#G97w@a|V22O0)6;W=D-lO2}#|6XPYZ0qltZ z6c~NPIuH@YK-X8|X&kN-L#P%6A)$K)pcrK1vCLGL_?l_Kcq`zyq|ZU zbwzXGs2V=5gpaG?P9@xVM_vv0s^POr`0QW$SHpuVp8B<5!&isCJhal(wHoYRtjKwT zU%aV!qbn^vinm9HJF57i*Wb?iPON$MEM~HvhIJP(3Lkms4m^M6CcbJQ)fLreZ_wAf zmaWR(=B%eB7do`asGgwW2_mVks6pz-UBRxm$lbRb-ACwq_L}Y}eJ{#FJC48FEEp4Y zQh)xxz(@la)U0KeeodODispAn(q<|$6DV)_6*I@Y29Lsh#tSJCON1~8?btJ4ZMi9L~QY$3YS*y9O1PRz#2@=+M>olf1sEd%W4$SNd4K;Y1c8~(*I5 zHL7PuM=BGKrSye|afan5$0wvbL6VT>HLH+Df(%pwpkwf2(|IY{2WC!;&EgTXUE0^_^E5S)$nb2t-kTA zb6=iYX*+#i{`36Z`PKfPuGatTUo_<(rWTn;2Liu7bM4F*^6G)Zi;kSfXE?p;2`irP zb%)y6t~9pa*|*x*_0ZG3?j+?k&!3h5|JWSvIzjH9aCA4(_t={5M*3bO3+;i39Ut83 z*to!PS{cWUXZXn!w#zy0{mEF$m=W<=rauylz=T0XJdUCs1^Sf{ZID6{1s=IXIk_{0nQ31g3) i;z^i5*O#h5tkV=leNUX<6PGSM|F#~bq8kK+zWBfWO(kal diff --git a/python/test/Cilent/__pycache__/__init__.cpython-312.pyc b/python/test/Cilent/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index c0d0e3a3c5289ca503695ad84dfeb421b89a9220..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3980 zcmeHKZA=`;8J^v}y<50DI0)Hw`10Y@B}vMNBKto(?I38bQ4MnS!- z!kkCF9Qf*WDIAr&;-b<$%!k~jw=J1aQ@VU6mPp0(4!{Xd{~Z0VbW?N!>3~^f0M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M&xj$BYLQ-r8^vrgjoBkEXQhGO`KI_=cd+R&cUE{Et-}2gtK3j9lMeG!ZWM5 zKS+mb7ie|`*JSnNZsL7%YG}^;<7|2T(z4a>9SrKbe|7{VDqe|1tj+ zYwSBr=W=YMv=S9ZDUV%Kc#^E1&eJID+B{}LuI9G!i>XSOFk zt7x~;>QL2W zK%Qe?XTL_Mg=^#f2~`J2he1WbFt;DTFxLm5Q?*cS6(Rp|jy^!yb5^zxq3IX>^hi-Q z!Ka5TpGhm3B(#09{8}cKw0o@d-AaXUfUY8bk%}A0@?d94kUe7%@Ymo1J&*3QZvIu~ ze!#=O!rZR}xl-xnk8}1gFpPv;CU2#081gO*H;3f~H$e;18O!}QLX$nOX536M`25gd eH!gDw!z`ex1yuL7yOBB0UD+|2T1C*Z2LA`a-%f4- diff --git a/python/test/Client/Chat_main.py b/python/test/Client/Chat_main.py new file mode 100644 index 0000000..fb68d3d --- /dev/null +++ b/python/test/Client/Chat_main.py @@ -0,0 +1,103 @@ +import wx +import wx.lib.scrolledpanel as scrolled +import threading + + +class ChatFrame(wx.Frame): + def __init__(self): + super().__init__(None, size=(1000, 700)) + + ChatMain_Panel = wx.Panel(self, style=wx.BORDER_SUNKEN) + ChatMain_box = wx.BoxSizer(wx.HORIZONTAL) + ChatMain_Panel.SetSizer(ChatMain_box) + + Function_Panel = wx.Panel(ChatMain_Panel, style=wx.BORDER_RAISED) + Function_box = wx.BoxSizer(wx.VERTICAL) + Function_Panel.SetSizer(Function_box) + Function_Panel.SetBackgroundColour(wx.Colour(242, 242, 242)) + + image_chat = r'./Client/image/chat.png' + Chat_bitmap = wx.Bitmap(image_chat, wx.BITMAP_TYPE_PNG) + Chat_bitmap_static = wx.StaticBitmap(Function_Panel, bitmap=Chat_bitmap, style=wx.BORDER_RAISED) + Chat_bitmap_static.SetToolTip("聊天") + Function_box.Add(Chat_bitmap_static, 1, wx.EXPAND, 0) + Chat_bitmap_static.Bind(wx.EVT_LEFT_DOWN, self.click_chat_button) + + Function_box.AddSpacer(30) # 调整这个数字以改变间距大小 + + image_connect = r'./Client/image/connect.png' + connect_bitmap = wx.Bitmap(image_connect, wx.BITMAP_TYPE_PNG) + connect_bitmap_static = wx.StaticBitmap(Function_Panel, bitmap=connect_bitmap, style=wx.BORDER_RAISED) + connect_bitmap_static.SetToolTip("通讯录") + Function_box.Add(connect_bitmap_static, 1, wx.EXPAND, 0) + connect_bitmap_static.Bind(wx.EVT_LEFT_DOWN, self.click_connect_button) + + Function_box.AddSpacer(28) # 调整这个数字以改变间距大小 + + image_find = r'./Client/image/find.png' + find_bitmap = wx.Bitmap(image_find, wx.BITMAP_TYPE_PNG) + find_bitmap_static = wx.StaticBitmap(Function_Panel, bitmap=find_bitmap, style=wx.BORDER_RAISED) + find_bitmap_static.SetToolTip("查找") + Function_box.Add(find_bitmap_static, 1, wx.EXPAND, 0) + find_bitmap_static.Bind(wx.EVT_LEFT_DOWN, self.click_find_button) + + Function_box.AddSpacer(340) # 调整这个数字以改变间距大小 + + image_site = r'./Client/image/site.png' + site_bitmap = wx.Bitmap(image_site, wx.BITMAP_TYPE_PNG) + site_bitmap_static = wx.StaticBitmap(Function_Panel, bitmap=site_bitmap, style=wx.BORDER_RAISED) + site_bitmap_static.SetToolTip("设置") + Function_box.Add(site_bitmap_static, 1, wx.EXPAND, 0) + site_bitmap_static.Bind(wx.EVT_LEFT_DOWN, self.click_site_button) + + Function_box.Fit(Function_Panel) # 调整面板大小以适应图像 + + ChatMain_box.Add(Function_Panel, 0, wx.EXPAND | wx.ALL, 5) + + operate_box = wx.BoxSizer(wx.VERTICAL) + + chat_page = self.ChatPage(ChatMain_Panel) # 将 ChatMain_Panel 作为 ChatPage 的 parent + operate_box.Add(chat_page, 1, wx.EXPAND, 0) + + ChatMain_box.Add(operate_box, 0, wx.EXPAND, 0) + + ChatMain_Panel.SetSizer(ChatMain_box) + + def click_chat_button(self, event): + print("点击了聊天") + + def click_connect_button(self, event): + print("点击了联系人") + + def click_site_button(self, event): + print("点击了设置") + + def click_find_button(self, event): + print("点击了查找") + + class ChatPage(wx.Panel): + def __init__(self, parent): + wx.Panel.__init__(self, parent, style=wx.BORDER_SUNKEN) + ChatPage_main_box = wx.BoxSizer(wx.HORIZONTAL) + + ChatPage_Contact_person_box = wx.BoxSizer(wx.VERTICAL) + self.ChatPage_Contact_person_panel = scrolled.ScrolledPanel(self, -1, style=wx.SUNKEN_BORDER) + self.ChatPage_Contact_person_panel.SetupScrolling() # 启用滚动功能 + self.ChatPage_Contact_person_panel.SetSizer(wx.BoxSizer(wx.VERTICAL)) + ChatPage_Contact_person_box.Add(self.ChatPage_Contact_person_panel, proportion=1, flag=wx.EXPAND | wx.ALL, + border=5) + ChatPage_main_box.Add(ChatPage_Contact_person_box, 0, wx.EXPAND, 0) + + + + + + self.SetSizer(ChatPage_main_box) + + + def ChatPage_add_Contact_person(self,NetName,info): + + + #self.ChatPage_Contact_person_panel.GetSizer().Add(, 0, wx.ALL, 5) + self.ChatPage_Contact_person_panel.Layout() # 重新布局滚动面板 + diff --git a/python/test/Cilent/Login.py b/python/test/Client/Login.py similarity index 100% rename from python/test/Cilent/Login.py rename to python/test/Client/Login.py diff --git a/python/test/Cilent/Session_server.py b/python/test/Client/Session_server.py similarity index 99% rename from python/test/Cilent/Session_server.py rename to python/test/Client/Session_server.py index 29cfc39..87f5841 100644 --- a/python/test/Cilent/Session_server.py +++ b/python/test/Client/Session_server.py @@ -57,3 +57,4 @@ class Session_server: except Exception as a: print("发送错误:" + str(a)) self.server_status = False + diff --git a/python/test/Cilent/__init__.py b/python/test/Client/__init__.py similarity index 66% rename from python/test/Cilent/__init__.py rename to python/test/Client/__init__.py index 9d93afb..8261eb0 100644 --- a/python/test/Cilent/__init__.py +++ b/python/test/Client/__init__.py @@ -31,13 +31,18 @@ class Client_main(LoginFrame, Session_server): def login_page_receive(self, receive_content): if receive_content["genre"] == '登录': - if receive_content["data"] == 0: - wx.MessageBox('登录成功', '登录', wx.OK | wx.ICON_INFORMATION) - elif receive_content["data"] == -1: - wx.MessageBox('重复登录', '登录', wx.OK | wx.ICON_INFORMATION) - elif receive_content["data"] == 1: - wx.MessageBox('密码错误', '登录', wx.OK | wx.ICON_INFORMATION) - elif receive_content["data"] == 2: - wx.MessageBox('未找到该账号', '登录', wx.OK | wx.ICON_INFORMATION) + match receive_content["data"]: + case 0: + wx.MessageBox('登录成功', '登录', wx.OK | wx.ICON_INFORMATION) + case -1: + wx.MessageBox('重复登录', '登录', wx.OK | wx.ICON_INFORMATION) + case 1: + wx.MessageBox('密码错误', '登录', wx.OK | wx.ICON_INFORMATION) + case 2: + wx.MessageBox('未找到该账号', '登录', wx.OK | wx.ICON_INFORMATION) elif receive_content["genre"] == '注册': - wx.MessageBox(f'注册成功\n网名 : {receive_content["data"]['NetName']} \n账号 : {receive_content["data"]['Id']} \n密码 : {receive_content["data"]['Password']}', '注册', wx.OK | wx.ICON_INFORMATION) \ No newline at end of file + wx.MessageBox( + f'注册成功\n网名 : {receive_content["data"]['NetName']} \n账号 : {receive_content["data"]['Id']} \n密码 : {receive_content["data"]['Password']}', + '注册', wx.OK | wx.ICON_INFORMATION) + + diff --git a/python/test/Client/image/chat.png b/python/test/Client/image/chat.png new file mode 100644 index 0000000000000000000000000000000000000000..9f5d40d42022944b894c964e076890b68bb17b4b GIT binary patch literal 2391 zcmV-d38?moP)FV00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D2<%BjK~!i%?O6#> zlt&gGu5crl93qII;4O$or4(0!ngSJ%=z0VTm5Qz!Evy7%g^9Z!wX$U?uI_4Wsw|Hv z#&x2r;)=tvibSOl10EoXE-1*60lAOi+VB0_Gu89^bGaO*Dqq#p>F(G4zwUnh`g@ID zTU(p#mkfRO|1TE5PN2Whqh|nP>6Mq4+tt<8nKv{vnDS$rnwmD4nVHqt+1aUBRgd8R znm~Phz1ho`FNb7gWK4MY@S#s>X{m!srE;jMsaDD-DjgggifwIe z%g2r#o8jy0o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SWi#S==S#Zmsf;PDD2Z}wJxJ&52G%*&6_v7=H%o&q00d{-Igs| z7F1qdev7SBwv1c9e*Mh6yu40Y2OJ0y5fO9B%F4bOsdrQ$fk3c8r_)_~Re{N55+Dd- zE~Vf00~3p3m>zl$u&3d2x3jYg9~v5hFMr>AMg^KUapKQ38qHN&(%#-)tJP{JzHN|K z?YX$PboTc4&V>H~ke{F5dgy0Z1r!nz;(h1NoeGMgpx%L=+lAKF)(t--(Cpc>zj*re zX|l;=LLs*c3JQv>s;a8C3h0M)+*aG;=5n?gc-!OO0ln=RXKL?VgqY6Q+m`700000NkvXXu0mjf_mwqk literal 0 HcmV?d00001 diff --git a/python/test/Client/image/find.png b/python/test/Client/image/find.png new file mode 100644 index 0000000000000000000000000000000000000000..953ae609158df3e2021ddf3d9ee972a0d368de80 GIT binary patch literal 1994 zcmV;*2Q~PKP)Px+gh@m}RA@u(ntyB?XBo%eJO4QQ{GjbSd83d!EAi@4Y3J48VlLi$-w15OlOB8LYs&wjBi)2m{H>rOmSI0i* ze9oQEz8AfgFEUZo=Ira{b$O*oas0l|^Zh)}z3=nN`7{)pr zj+alIIPu+BELMAvz^Z_{-R@^umOWjo)$HwvB?uxB2n4<}KR-X!&iLJo=?K*C_ZxYh zpDdM1Pi)U1j^iATE0xMew+AQ`3O%{7u%J3@+n_F& z>xT@(ywEC?B*|-5tM!RgDz&tWh+|%__Xxu&20T&{4bRC*IaC8U~lE|h(==b{vZ{NP1=tL9(TUuKBTT52+6B84@$;nBv6T9+Q z#h_lV_e?&Y|EX-Cr>E!Vxm@nF8e)t_<6E^_?Gf1)MNywxUS6J7!?sdTjoEBo6$GIN zIma-J^Z9)K<>h5nN;-$b@jT12KbFC)R_mGd^>wu1b=(wz1_A-!>gsAn_Nvinl047v z2LPy2)%5rG52R8lGzA*EOeWK-48wf2W6E8WY5(WLZnqDW%jLNIN4;KujpMjas3D|j z10zY25k;}FC>acf>nzKDTn+n*GD?!<$3#(lQ+8}Nn=clN#mCeTB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1KX9L2*l^}oug^`+2-ThU^AP| z=ZeMRa}O2h=;)~S`t|EGJkO8Fu;||fB9X`!;_>*5QrND|C;|xvgCn_I?lOeXh#p_m z2!goDaU7bzifZAm25l}*rx}L%nGA~K_)7B%N6~xJt_MX|E}NU1)0IjEopnKPZ|}Ku zI<0t~c0DM9LvPtHU%otMFc>P?Y__c}=6wOGbm7^l{~o9sQS2rgdl~JfY^b4SFQaNi cv72oC53PdFS!S{FjQ{`u07*qoM6N<$f@uiVegFUf literal 0 HcmV?d00001 diff --git a/python/test/Client/image/site.png b/python/test/Client/image/site.png new file mode 100644 index 0000000000000000000000000000000000000000..4c6f2e65015209d6d538be2e4584d2062cc2864e GIT binary patch literal 4257 zcmV;S5MJ+zP)Px_TS-JgRA@u(S_@QDXSU8cIVW$Tkc2?Mf<-}45XANhSfs5}0ReC8U^VKr^-dpN zt*=#l+)g#4eb{z7+>6qyPOoySZGG40st+9LMN3;~1r(erFC_s119_a}uy2{_@K&Ke5?tv0g<01jlha`0X81sq|7#PEN*w0|&_AC>)6P zCj;U*j*lRS%U1x3q8m7lgAefLFbwNMQM4C95EMa>P=~`IlSm{yi9}+^%gb9(R#sNg zpND52@OB1L-meD?a}tu2loZ?9*}2waGR;=0R23M8?NF=LHAO{5Js*7VL3l$$!}|n5 z%muz8k*GzfRQ{V@uXiggl}fcN%kJXwcmfnfSrkS8clz|{McLWemYq9yMjMUBX}!I@ zO9+B^_~C~i{4VQ&8ci{RnQb2^=F-C!?;hK3%0?X}ky78MoQ0)Yw$C@U*V zR$E*9j>Tg6ca~+r0^nxGoSdAOo0^)!uV26Z8bwhWSbY>lofw80!o$N)R#jE4(P%Vw ze+m>76r_}wmv3MgCXHd3U~pdqK`4<(bR|DO|BZ_mFFw`T*$MK5fCn_ zOmrws7a+#Y1`Y|YlfrX zaA{R4Rd#Q0?>?8yB?q}One5|)goI_^eDjUvfdFM?WnncnHE)n4`MS&H0$*n|8qKRO zzWCx_bUNLS(cnI#rltljEiE0{*ViZ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C^sC&kYE~(Mv+h`6o^D3cbKPX+9{Dp=miTF*oShH zFdTVzkCC4;>7RMd-^Jzrk$`^%^p9Nqp~(KlS?K=(LFZzkZLYvn00000NkvXXu0mjf DhXo$0 literal 0 HcmV?d00001 diff --git a/python/test/StartClient.py b/python/test/StartClient.py index bf671c9..a5804bf 100644 --- a/python/test/StartClient.py +++ b/python/test/StartClient.py @@ -1,5 +1,5 @@ import wx -from Cilent import Client_main +from Client import Client_main if __name__ == '__main__': app = wx.App() diff --git a/python/test/test.py b/python/test/test.py index 3706489..1b89490 100644 --- a/python/test/test.py +++ b/python/test/test.py @@ -1,26 +1,34 @@ -import wx +# 服务端 +import socket +import cv2 +import pickle +import struct -app = wx.App() +HOST = '127.0.0.1' # 服务器IP地址 +PORT = 65432 # 监听端口 -# 创建一个Frame -frame = wx.Frame(None, -1, '多行文本弹窗示例', size=(300, 200)) -frame.Center() +# 创建Socket +server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +server_socket.bind((HOST, PORT)) +server_socket.listen(5) -# 创建一个Panel -panel = wx.Panel(frame, -1) +# 接受客户端连接 +connection, address = server_socket.accept() +print('Connected by', address) -# 创建一个按钮 -button = wx.Button(panel, -1, '点击弹窗', pos=(100, 50)) +# 使用OpenCV捕获视频 +cap = cv2.VideoCapture(0) -# 定义按钮的点击事件处理函数 -def on_button_click(event): - message = "这是一个多行文本的弹窗。\n第二行文本。\n第三行文本。" - dlg = wx.MessageDialog(frame, message, '多行文本提示', wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() +while True: + ret, frame = cap.read() + # 将视频帧序列化 + data = pickle.dumps(frame) + # 将序列化的数据封装成一个结构体 + message = struct.pack("Q", len(data)) + data + # 发送数据到客户端 + connection.sendall(message) -# 绑定按钮的点击事件 -button.Bind(wx.EVT_BUTTON, on_button_click) - -frame.Show() -app.MainLoop() +# 释放资源 +connection.close() +server_socket.close() +cap.release() diff --git a/python/test/test2.py b/python/test/test2.py new file mode 100644 index 0000000..0838e74 --- /dev/null +++ b/python/test/test2.py @@ -0,0 +1,43 @@ +# 客户端 +import socket +import cv2 +import pickle +import struct + +HOST = '127.0.0.1' # 服务器IP地址 +PORT = 65432 # 连接端口 + +# 创建Socket +client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +client_socket.connect((HOST, PORT)) + +# 接收数据 +data = b"" +payload_size = struct.calcsize("Q") +while True: + # 从服务器接收数据 + while len(data) < payload_size: + packet = client_socket.recv(4*1024) + if not packet: break + data += packet + packed_msg_size = data[:payload_size] + data = data[payload_size:] + msg_size = struct.unpack("Q", packed_msg_size)[0] + + # 接收视频帧 + while len(data) < msg_size: + data += client_socket.recv(4*1024) + frame_data = data[:msg_size] + data = data[msg_size:] + + # 反序列化视频帧 + frame = pickle.loads(frame_data) + + # 显示视频 + cv2.imshow('frame', frame) + if cv2.waitKey(1) == 27: + break + +# 释放资源 +client_socket.close() +cv2.destroyAllWindows() diff --git a/python/test/test_plan.py b/python/test/test_plan.py new file mode 100644 index 0000000..9470ff0 --- /dev/null +++ b/python/test/test_plan.py @@ -0,0 +1,9 @@ +import wx +from Client.Chat_main import ChatFrame + +if __name__ == '__main__': + app = wx.App() + frame = ChatFrame() + frame.Show() + app.MainLoop() +