Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 30aca5c0
由
LN
编写于
2024-02-01 09:10:05 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
调试修改
1 个父辈
b4cfc899
全部展开
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
80 行增加
和
26 行删除
DeviceLibrary/deviceLibrary/IO/NanjingSDotIO.cs
DeviceLibrary/deviceLibrary/ledLabel/LedLabelController.cs
DeviceLibrary/manager/WorkInfo.cs
TSA-V/FrmAddBoard.cs
TSA-V/FrmPointInfo.cs
TSA-V/projector/FrmProjectorScreen.cs
TSA-V/projector/FrmViewScreen.cs
UserFromControl/ProjectorControl.cs
DeviceLibrary/deviceLibrary/IO/NanjingSDotIO.cs
查看文件 @
30aca5c
...
...
@@ -105,6 +105,8 @@ class NanjingSDotIO : IOBase
/// </summary>
void
iomonitor
()
{
try
{
iomonitorrun
=
true
;
while
(
iomonitorrun
&&
systemrun
)
{
...
...
@@ -115,7 +117,7 @@ class NanjingSDotIO : IOBase
}
catch
(
SocketException
)
{
if
(
tcpClient
!=
null
&&
tcpClient
.
Connected
)
if
(
tcpClient
!=
null
&&
tcpClient
.
Connected
)
tcpClient
.
Close
();
ConnectionState_Event
?.
Invoke
(
this
,
false
);
iomonitorrun
=
false
;
...
...
@@ -129,6 +131,11 @@ class NanjingSDotIO : IOBase
}
while
(
systemrun
&&
!
Open
());
}
}
catch
(
Exception
ex
)
{
TSA_V
.
Common
.
LogUtil
.
error
(
$
"IO模块{IP}出错:"
+
ex
.
ToString
());
}
}
/// <summary>
/// 写io
...
...
DeviceLibrary/deviceLibrary/ledLabel/LedLabelController.cs
查看文件 @
30aca5c
using
System.Collections.Generic
;
using
System
;
using
System.Collections.Generic
;
using
System.Net.Http
;
using
TSA_V.Common
;
using
TSA_V.LoadCSVLibrary
;
...
...
@@ -36,7 +37,7 @@ namespace TSA_V.DeviceLibrary
{
string
url
=
$
"http://{ip}/wms/associate/lightTagsLed"
;
string
json
=
JsonHelper
.
SerializeObject
(
getLedMaps
(
macs
,
ledvs
));
Post
(
url
,
json
);
Post
(
url
,
json
,(
open
?
"打开所有"
:
"关闭所有"
)
);
}
}
public
static
LabelInfo
GetLabel
(
TSAVPosition
position
,
ComponetInfo
com
,
bool
opendLed
=
false
)
...
...
@@ -107,7 +108,7 @@ namespace TSA_V.DeviceLibrary
Dictionary
<
string
,
object
>
keyValuePairss
=
getLedMap
(
mac
,
ledrgb
);
string
json
=
JsonHelper
.
SerializeObject
(
keyValuePairss
);
string
value
=
$
"[{json}]"
;
Post
(
url
,
value
);
Post
(
url
,
value
,
mac
+
(
openLed
?
"开灯"
:
"关灯"
)
);
}
public
static
void
UpdateScreen
(
LabelInfo
label
)
{
...
...
@@ -141,10 +142,12 @@ namespace TSA_V.DeviceLibrary
}
string
json
=
JsonHelper
.
SerializeObject
(
dic
);
string
value
=
$
"[{json}]"
;
Post
(
url
,
value
);
Post
(
url
,
value
,
"更新屏幕"
);
}
public
static
async
void
Post
(
string
url
,
string
json
)
public
static
async
void
Post
(
string
url
,
string
json
,
string
opName
=
""
)
{
try
{
using
(
var
client
=
new
HttpClient
())
{
...
...
@@ -152,25 +155,27 @@ namespace TSA_V.DeviceLibrary
{
var
contents
=
new
StringContent
(
$
"{json}"
,
null
,
"application/json"
);
request
.
Content
=
contents
;
using
(
HttpResponseMessage
response
=
await
client
.
SendAsync
(
request
)
)
using
(
HttpResponseMessage
response
=
await
client
.
SendAsync
(
request
)
)
{
if
(
response
.
IsSuccessStatusCode
)
{
string
jsonResponse
=
response
.
Content
.
ReadAsStringAsync
().
Result
;
LogUtil
.
info
(
$
"电子屏
发送{json} 结果 {response.IsSuccessStatusCode}: "
+
jsonResponse
);
LogUtil
.
info
(
$
"电子屏 {opName}
发送{json} 结果 {response.IsSuccessStatusCode}: "
+
jsonResponse
);
}
else
{
string
jsonResponse
=
response
.
Content
.
ReadAsStringAsync
().
Result
;
LogUtil
.
info
(
$
"电子屏 发送{json} 结果 {response.IsSuccessStatusCode}: "
+
jsonResponse
);
LogUtil
.
info
(
$
"电子屏 {opName} 发送{json} 结果 {response.IsSuccessStatusCode}: "
+
jsonResponse
);
}
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
info
(
$
"电子屏 {opName} 发送{json} 出错 {ex.ToString()}"
);
}
}
// {
// "mac":"99.96.19.64",
// "mappingtype":868,
...
...
DeviceLibrary/manager/WorkInfo.cs
查看文件 @
30aca5c
...
...
@@ -55,6 +55,11 @@ namespace TSA_V.DeviceLibrary
currIndex
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TagNumber
);
isContinue
=
false
;
}
else
{
LogUtil
.
info
(
"开始程序【"
+
boardInfo
.
boardName
+
"】的插件,关闭所有灯"
);
LedLabelController
.
CloseAll
();
}
IsShowAOI
=
false
;
currPoint
=
null
;
IsWorking
=
true
;
...
...
@@ -191,6 +196,11 @@ namespace TSA_V.DeviceLibrary
//上一个节点返回原点
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
}
if
(
PreLabel
!=
null
)
{
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
Thread
.
Sleep
(
300
);
}
//if (TSAVBean.IsNeedSoldering)
//{
// LogUtil.info(" 程序【" + currBoard.boardName + "】需要焊接,打开烙铁灯 ");
...
...
@@ -302,6 +312,7 @@ namespace TSA_V.DeviceLibrary
if
(
PreLabel
!=
null
)
{
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
Thread
.
Sleep
(
300
);
}
//LedManager.LedOFFALL();
if
(
position
.
PositionType
.
Equals
(
1
))
...
...
TSA-V/FrmAddBoard.cs
查看文件 @
30aca5c
...
...
@@ -12,6 +12,7 @@ using System.Windows.Forms;
using
TSA_V.Common
;
using
TSA_V.DeviceLibrary
;
using
TSA_V.LoadCSVLibrary
;
using
UserFromControl
;
namespace
TSA_V
{
...
...
@@ -316,8 +317,8 @@ namespace TSA_V
xyMoveControl1
.
ShowPointEvent
+=
XyMoveControl1_ShowPointEvent
;
xyMoveControl1
.
XValue
=
TSAVBean
.
X_Max
/
2
;
xyMoveControl1
.
YValue
=
TSAVBean
.
Y_Max
/
2
;
xyMoveControl1
.
MaxX
=(
int
)
TSAVBean
.
X_Max
;
xyMoveControl1
.
MaxY
=
(
int
)
TSAVBean
.
Y_Max
;
ProjectorControl
.
MaxX
=(
int
)
TSAVBean
.
X_Max
;
ProjectorControl
.
MaxY
=
(
int
)
TSAVBean
.
Y_Max
;
xyMoveControl1
.
ShowText
=
""
;
rdbUpload
.
Checked
=
true
;
...
...
TSA-V/FrmPointInfo.cs
查看文件 @
30aca5c
...
...
@@ -13,6 +13,7 @@ using TSA_V.Common;
using
PUSICANLibrary
;
using
TSA_V.LoadCSVLibrary
;
using
AccAOI
;
using
UserFromControl
;
namespace
TSA_V
{
...
...
@@ -41,8 +42,8 @@ namespace TSA_V
xyMoveControl1
.
XValue
=
nodex
;
xyMoveControl1
.
YValue
=
nodey
;
xyMoveControl1
.
MaxX
=
(
int
)
TSAVBean
.
X_Max
;
xyMoveControl1
.
MaxY
=
(
int
)
TSAVBean
.
Y_Max
;
ProjectorControl
.
MaxX
=
(
int
)
TSAVBean
.
X_Max
;
ProjectorControl
.
MaxY
=
(
int
)
TSAVBean
.
Y_Max
;
this
.
txtX
.
Text
=
x
.
ToString
();
this
.
txtY
.
Text
=
y
.
ToString
();
...
...
@@ -122,8 +123,8 @@ namespace TSA_V
return
;
}
xyMoveControl1
.
ShowPointEvent
+=
XyMoveControl1_ShowPointEvent
;
xyMoveControl1
.
MaxX
=
(
int
)
TSAVBean
.
X_Max
;
xyMoveControl1
.
MaxY
=
(
int
)
TSAVBean
.
Y_Max
;
ProjectorControl
.
MaxX
=
(
int
)
TSAVBean
.
X_Max
;
ProjectorControl
.
MaxY
=
(
int
)
TSAVBean
.
Y_Max
;
this
.
PointList
=
list
;
this
.
CurrIndex
=
currIndex
;
ShowPoint
();
...
...
TSA-V/projector/FrmProjectorScreen.cs
查看文件 @
30aca5c
...
...
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
using
System.Windows.Forms
;
using
TSA_V.Common
;
using
TSA_V.DeviceLibrary
;
using
UserFromControl
;
namespace
TSA_V
{
...
...
@@ -33,7 +34,7 @@ namespace TSA_V
// private bool hasShow = false;
private
void
FrmScreenTest_Load
(
object
sender
,
EventArgs
e
)
{
this
.
Text
=
"
显示测试
_"
+
ScreenIndex
;
this
.
Text
=
"
投影
_"
+
ScreenIndex
;
this
.
StartPosition
=
FormStartPosition
.
Manual
;
timer1
.
Start
();
if
(
panel1
.
BackgroundImage
!=
null
)
...
...
@@ -76,12 +77,13 @@ namespace TSA_V
TSAVBean
.
Y_Max
=
ScreenHeight
;
TSAVBean
.
X_Min
=
1
;
TSAVBean
.
Y_Min
=
1
;
ProjectorControl
.
MaxX
=
(
int
)
TSAVBean
.
X_Max
;
ProjectorControl
.
MaxY
=
(
int
)
TSAVBean
.
Y_Max
;
ISShow
=
true
;
this
.
Location
=
new
Point
(
screen
.
Bounds
.
Left
,
screen
.
Bounds
.
Top
);
this
.
Show
();
LogUtil
.
info
(
$
"投影显示成功,屏幕索引={ ScreenIndex} , 位置X:{screen.Bounds.Left} ,Y:{screen.Bounds.Top} "
);
LogUtil
.
info
(
$
"投影显示成功,屏幕索引={ ScreenIndex} , 位置X:{screen.Bounds.Left} ,Y:{screen.Bounds.Top}
,范围 X:{ScreenWidth},Y:{ScreenHeight}
"
);
return
true
;
}
else
...
...
@@ -118,22 +120,29 @@ namespace TSA_V
//循环画线
for
(
int
i
=
0
;
i
<=
Point_X_Length
;
i
++)
{
float
line
=
0.
2F
;
float
line
=
2F
;
float
picLocationX
=
startX
+
lineWidth
*
i
;
if
(
picLocationX
>=
ScreenWidth
)
{
picLocationX
=
ScreenWidth
-
2
;
}
else
if
(
picLocationX
==
0
)
{
picLocationX
=
2
;
}
grfx
.
DrawLine
(
new
Pen
(
color
,
line
),
picLocationX
,
startY
,
picLocationX
,
ScreenHeight
);
}
for
(
int
i
=
0
;
i
<=
Point_Y_Length
;
i
++)
{
float
line
=
0.
2F
;
float
line
=
2F
;
float
picLocationY
=
startY
+
lineHeight
*
i
;
if
(
picLocationY
>=
ScreenHeight
)
{
picLocationY
=
ScreenHeight
-
1
;
}
else
if
(
picLocationY
==
0
)
{
picLocationY
=
2
;
}
grfx
.
DrawLine
(
new
Pen
(
color
,
line
),
startX
,
picLocationY
,
ScreenWidth
,
picLocationY
);
}
...
...
TSA-V/projector/FrmViewScreen.cs
查看文件 @
30aca5c
此文件的差异被折叠,
点击展开。
UserFromControl/ProjectorControl.cs
查看文件 @
30aca5c
...
...
@@ -14,8 +14,8 @@ namespace UserFromControl
{
public
partial
class
ProjectorControl
:
UserControl
{
public
int
MaxX
=
1920
;
public
int
MaxY
=
1280
;
public
static
int
MaxX
=
1920
;
public
static
int
MaxY
=
1280
;
public
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
public
event
ShowPointDelegate
ShowPointEvent
;
public
ProjectorControl
()
...
...
@@ -31,7 +31,7 @@ namespace UserFromControl
PointType
=
TSAVBean
.
DefaultPType
;
numSizeX
.
Maximum
=
MaxX
/
2
;
numSizeY
.
Maximum
=
MaxY
/
2
;
//LogUtil.info($"投影点位范围:X:{MaxX},Y:{MaxY}");
typeList
=
new
List
<
string
>();
this
.
cmbType
.
Items
.
Clear
();
typeList
.
AddRange
(
new
string
[]
{
...
...
@@ -130,6 +130,11 @@ namespace UserFromControl
numY
.
Text
=
targetValue
.
ToString
();
ShowCurrPoint
();
}
else
{
numY
.
Text
=
1.
ToString
();
ShowCurrPoint
();
}
}
private
void
btnLeft_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -141,6 +146,11 @@ namespace UserFromControl
numX
.
Text
=
targetValue
.
ToString
();
ShowCurrPoint
();
}
else
{
numX
.
Text
=
1.
ToString
();
ShowCurrPoint
();
}
}
private
void
btnRight_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -153,6 +163,11 @@ namespace UserFromControl
numX
.
Text
=
targetValue
.
ToString
();
ShowCurrPoint
();
}
else
{
numX
.
Text
=
MaxX
.
ToString
();
ShowCurrPoint
();
}
}
private
void
btnDown_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -164,6 +179,11 @@ namespace UserFromControl
numY
.
Text
=
targetValue
.
ToString
();
ShowCurrPoint
();
}
else
{
numY
.
Text
=
MaxY
.
ToString
();
ShowCurrPoint
();
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论