Commit 6efdc3db authored by 潘栩锋's avatar 潘栩锋 🚴

修改全部字体为 Arial

parent 3d8e7538
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<Setter Property="Foreground" Value="#FF3B3B3B" /> <Setter Property="Foreground" Value="#FF3B3B3B" />
<Setter Property="FontWeight" Value="Bold" /> <Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="36" /> <Setter Property="FontSize" Value="36" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" /> <Setter Property="FontFamily" Value="Arial" />
<Setter Property="TextAlignment" Value="Left" /> <Setter Property="TextAlignment" Value="Left" />
</Style> </Style>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<Setter Property="Foreground" Value="#FF3B3B3B" /> <Setter Property="Foreground" Value="#FF3B3B3B" />
<Setter Property="FontWeight" Value="Bold" /> <Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="36" /> <Setter Property="FontSize" Value="36" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" /> <Setter Property="FontFamily" Value="Arial" />
<Setter Property="TextAlignment" Value="Left" /> <Setter Property="TextAlignment" Value="Left" />
<Setter Property="MinWidth" Value="30" /> <Setter Property="MinWidth" Value="30" />
</Style> </Style>
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent_mm_interval"> <Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent_mm_interval">
<Setter Property="Foreground" Value="#FF888888" /> <Setter Property="Foreground" Value="#FF888888" />
<Setter Property="FontSize" Value="36" /> <Setter Property="FontSize" Value="36" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" /> <Setter Property="FontFamily" Value="Arial" />
<Setter Property="TextAlignment" Value="Left" /> <Setter Property="TextAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Bottom" /> <Setter Property="VerticalAlignment" Value="Bottom" />
</Style> </Style>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent_mm"> <Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent_mm">
<Setter Property="Foreground" Value="#FF888888" /> <Setter Property="Foreground" Value="#FF888888" />
<Setter Property="FontSize" Value="22" /> <Setter Property="FontSize" Value="22" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" /> <Setter Property="FontFamily" Value="Arial" />
<Setter Property="TextAlignment" Value="Left" /> <Setter Property="TextAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Bottom" /> <Setter Property="VerticalAlignment" Value="Bottom" />
</Style> </Style>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<SolidColorBrush x:Key="Color_dark" Color="#8e9aa8"/> <SolidColorBrush x:Key="Color_dark" Color="#8e9aa8"/>
<Style TargetType="TextBlock" x:Key="TextBlockStyle_abc"> <Style TargetType="TextBlock" x:Key="TextBlockStyle_abc">
<Setter Property="FontSize" Value="20" /> <Setter Property="FontSize" Value="20" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" /> <Setter Property="FontFamily" Value="Arial" />
</Style> </Style>
<Style TargetType="Button" x:Key="ButtonStyle_key"> <Style TargetType="Button" x:Key="ButtonStyle_key">
<Setter Property="Margin" Value="3"/> <Setter Property="Margin" Value="3"/>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<SolidColorBrush x:Key="Color_dark" Color="#8e9aa8"/> <SolidColorBrush x:Key="Color_dark" Color="#8e9aa8"/>
<Style TargetType="TextBlock" x:Key="TextBlockStyle_abc"> <Style TargetType="TextBlock" x:Key="TextBlockStyle_abc">
<Setter Property="FontSize" Value="20" /> <Setter Property="FontSize" Value="20" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" /> <Setter Property="FontFamily" Value="Arial" />
</Style> </Style>
<Style TargetType="Button" x:Key="ButtonStyle_key"> <Style TargetType="Button" x:Key="ButtonStyle_key">
<Setter Property="Margin" Value="3"/> <Setter Property="Margin" Value="3"/>
......
...@@ -39,9 +39,14 @@ namespace FObjBase ...@@ -39,9 +39,14 @@ namespace FObjBase
public virtual int SendPacket(byte[] buffer) public virtual int SendPacket(byte[] buffer)
{ {
int len = buffer.Length; lock (out_buffer)
out_buffer.AddRange(buffer); {
return len; int len = buffer.Length;
out_buffer.AddRange(buffer);
return len;
}
} }
protected virtual int GetRecvInfoPacket() // return length of the packet protected virtual int GetRecvInfoPacket() // return length of the packet
...@@ -123,35 +128,37 @@ namespace FObjBase ...@@ -123,35 +128,37 @@ namespace FObjBase
} }
int Send_Poll() int Send_Poll()
{ {
int cnt_total = 0;
if (out_buffer.Count() == 0)//没数据,直接返回 if (out_buffer.Count() == 0)//没数据,直接返回
return 0; return 0;
lock (out_buffer) {
while (out_buffer.Count() > 0)//只有有数据发送,且能发送,没有 block, 就会一直循环 int cnt_total = 0;
{ while (out_buffer.Count() > 0)//只有有数据发送,且能发送,没有 block, 就会一直循环
int cnt;
try
{ {
cnt = sock.Send(out_buffer.ToArray()); int cnt;
} try
catch (System.Net.Sockets.SocketException e) {
{ cnt = sock.Send(out_buffer.ToArray());
if (e.SocketErrorCode == SocketError.WouldBlock)//当前发不了,退出循环,等下次!!!! }
break; catch (System.Net.Sockets.SocketException e)
return -1;//异常,断开连接!!! {
} if (e.SocketErrorCode == SocketError.WouldBlock)//当前发不了,退出循环,等下次!!!!
break;
return -1;//异常,断开连接!!!
}
if (cnt > 0) if (cnt > 0)
{ {
out_buffer.RemoveRange(0, cnt);//发送成功,删除!!! out_buffer.RemoveRange(0, cnt);//发送成功,删除!!!
cnt_total+=cnt; cnt_total+=cnt;
} }
else else
{ {
break; break;
}
} }
return cnt_total;//返回总发送量
} }
return cnt_total;//返回总发送量
} }
int Receive_Poll() int Receive_Poll()
...@@ -269,7 +276,10 @@ namespace FObjBase ...@@ -269,7 +276,10 @@ namespace FObjBase
logger.Error("TCPConn OnPoll 连接断开,清空接收缓存区"); logger.Error("TCPConn OnPoll 连接断开,清空接收缓存区");
in_buffer.Clear(); in_buffer.Clear();
out_buffer.Clear(); lock(out_buffer)
{
out_buffer.Clear();
}
Enable = false; Enable = false;
} }
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment