Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 43974366
由
LN
编写于
2024-02-04 16:20:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
配置修改
1 个父辈
693f71b1
显示空白字符变更
内嵌
并排
正在显示
38 个修改的文件
包含
622 行增加
和
465 行删除
Common/Common.csproj
Common/Setting_Init.cs
Common/Setting_NInit.cs
Common/util/ConfigAppSettings.cs
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/bean/BoardInfo.cs
DeviceLibrary/csvLoad/CSVReaderBase.cs
DeviceLibrary/deviceLibrary/IO/IOBase.cs
DeviceLibrary/deviceLibrary/IO/IOManager.cs
DeviceLibrary/manager/BoardManager.cs
DeviceLibrary/manager/LineWidthManager.cs
DeviceLibrary/manager/ProjectorProcess.cs
DeviceLibrary/manager/TSAVBean.cs
DeviceLibrary/manager/TSAVBean_Partial.cs
DeviceLibrary/manager/WorkInfo.cs
DeviceLibrary/mes/MesUtil.cs
DeviceLibrary/smf/MyWebClient.cs
DeviceLibrary/smf/ServerCommunication.cs
TSA-V/DataCalculate.cs
TSA-V/FrmChangeWidth.cs
TSA-V/FrmDeviceConfig.Designer.cs
TSA-V/FrmDeviceConfig.cs
TSA-V/FrmLanguage.cs
TSA-V/FrmLogin.cs
TSA-V/FrmMenu.cs
TSA-V/Program.cs
TSA-V/Smart-Workstation.csproj
TSA-V/deviceDebug/FrmPusicanTest.cs
TSA-V/projector/FrmProjectorScreen.cs
TSA-V/workForm/FrmAOICheck.cs
TSA-V/workForm/FrmBoardSelect.cs
TSA-V/workForm/FrmTSAV.cs
TSA-V/workForm/FrmWorkCount.cs
UserFromControl/ProjectorControl.cs
UserFromControl/UserFromControl.csproj
dll/ConfigHelper.dll
dll/ConfigHelper.pdb
dll/ConfigHelper.xml
Common/Common.csproj
查看文件 @
4397436
...
...
@@ -35,6 +35,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="ConfigHelper">
<HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\dll\log4net.dll</HintPath>
</Reference>
...
...
@@ -73,6 +76,7 @@
<Compile Include="logs\TempLog.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting_Init.cs" />
<Compile Include="Setting_NInit.cs" />
<Compile Include="util\AcSerialBean.cs" />
<Compile Include="util\ConfigAppSettings.cs" />
<Compile Include="util\FileUtil.cs" />
...
...
Common/Setting_Init.cs
查看文件 @
4397436
...
...
@@ -11,14 +11,15 @@ namespace TSA_V.Common
/// </summary>
public
class
Setting_Init
{
//public static string PUSICAN_Position = "PUSICAN_Position";
/// <summary>
/// 1时自动启动,并隐藏窗口,=0时不需要
/// </summary>
public
static
string
App_AutoRun
=
"App_AutoRun"
;
/// <summary>
/// 系统主界面标题
/// AOI文件路径
/// </summary>
public
static
string
App_Title
=
"App_Title"
;
public
static
string
AOIFileConfig
=
"AOIFileConfig"
;
public
static
string
Default_BoardID
=
"Default_BoardID"
;
public
static
string
Board_ConfigPath
=
"Board_ConfigPath"
;
public
static
string
Position_Config
=
"Position_Config"
;
public
static
string
Position_Config_Label
=
"Position_Config_Label"
;
...
...
@@ -33,27 +34,17 @@ namespace TSA_V.Common
/// 默认图片
/// </summary>
public
static
string
BOARD_IMAGE_DEFAULT
=
"BOARD_IMAGE_DEFAULT"
;
/// <summary>
/// 康奈德Ip配置
/// </summary>
public
static
string
IO_IP
=
"IO_IP"
;
public
static
string
IO_Port
=
"IO_Port"
;
public
static
string
Default_BoardID
=
"Default_BoardID"
;
/// <summary>
///
IP地址
///
元器件信息模板
/// </summary>
public
static
string
PUSICAN_Ip
=
"PUSICAN_Ip"
;
public
static
string
Componet_Template
=
"Componet_Template"
;
public
static
string
AuToSoldering_FilePath
=
"AuToSoldering_FilePath"
;
/// <summary>
///
端口号
///
料盘旋转轴
/// </summary>
public
static
string
PUSICAN_Port
=
"PUSICAN_Port"
;
public
static
string
PUSICAN_Position
=
"PUSICAN_Position"
;
public
static
string
RNode_Addr
=
"RNode_Addr"
;
public
static
string
RotateNode_MicroStepping
=
"RotateNode_MicroStepping"
;
public
static
string
RotateNode_MaxSpeed
=
"RotateNode_MaxSpeed"
;
public
static
string
RotateNode_StartSpeed
=
"RotateNode_StartSpeed"
;
...
...
@@ -67,31 +58,68 @@ namespace TSA_V.Common
public
static
string
RotateNode_HomeStopSpeed
=
"RotateNode_HomeStopSpeed"
;
/// <summary>
///
料盘旋转轴
///
旋转轴(库位轴)默认的位置
/// </summary>
public
static
string
RNode_Addr
=
"RNode_Addr"
;
public
static
string
RotateNode_DefaultPosition
=
"RotateNode_DefaultPosition"
;
/// <summary>
/// 元器件库的数量,=1表示有一个五层的料库
/// </summary>
public
static
string
TSAV_Storage_Count
=
"TSAV_Storage_Count"
;
public
static
string
Line_HomeSpeed
=
"Line_HomeSpeed"
;
public
static
string
Line_HomeStartSpeed
=
"Line_HomeStartSpeed"
;
public
static
string
Line_HomeStopSpeed
=
"Line_HomeStopSpeed"
;
public
static
string
Line_MicroStepping
=
"Line_MicroStepping"
;
public
static
string
Line_MaxSpeed
=
"Line_MaxSpeed"
;
public
static
string
Line_StartSpeed
=
"Line_StartSpeed"
;
public
static
string
Line_StopSpeed
=
"Line_StopSpeed"
;
public
static
string
Line_AddSpeed
=
"Line_AddSpeed"
;
public
static
string
Line_DelSpeed
=
"Line_DelSpeed"
;
public
static
string
Line_MaxPhaseCurrent
=
"Line_MaxPhaseCurrent"
;
public
static
string
Line_DelPhaseCurrent
=
"Line_DelPhaseCurrent"
;
/// <summary>
///
旋转轴(库位轴)默认的位置
///
IP地址
/// </summary>
public
static
string
RotateNode_DefaultPosition
=
"RotateNode_DefaultPosition"
;
public
static
string
PUSICAN_Ip
=
"PUSICAN_Ip"
;
/// <summary>
///
元器件信息模板
///
端口号
/// </summary>
public
static
string
Componet_Template
=
"Componet_Template"
;
public
static
string
Default_Language
=
"Default_Language"
;
public
static
string
PUSICAN_Port
=
"PUSICAN_Port"
;
public
static
string
AuToSoldering_FilePath
=
"AuToSoldering_FilePath"
;
public
static
string
IsDebug
=
"IsDebug"
;
//以下配置已迁移
public
static
string
Line_HomeWidth
=
"Line_HomeWidth"
;
public
static
string
Line_ChangeValue
=
"Line_ChangeValue"
;
public
static
string
Line_NodeAddr
=
"Line_NodeAddr"
;
public
static
string
Line_LastWidth
=
"Line_LastWidth"
;
public
static
string
Line_WidthPosition
=
"Line_WidthPosition"
;
public
static
string
Default_Language
=
"Default_Language"
;
/// <summary>
/// 1时自动启动,并隐藏窗口,=0时不需要
/// </summary>
public
static
string
App_AutoRun
=
"App_AutoRun"
;
/// <summary>
/// 系统主界面标题
/// </summary>
public
static
string
App_Title
=
"App_Title"
;
/// <summary>
/// 康奈德Ip配置
/// </summary>
public
static
string
IO_IP
=
"IO_IP"
;
public
static
string
IO_Port
=
"IO_Port"
;
public
static
string
IsDebug
=
"IsDebug"
;
public
static
string
SolderingLedIP
=
"SolderingLedIP"
;
public
static
string
SolderingLedIndex
=
"SolderingLedIndex"
;
public
static
string
CameraName
=
"CameraName"
;
...
...
@@ -119,10 +147,6 @@ namespace TSA_V.Common
/// 元器件库名称的类型,0=英文,1=中文
/// </summary>
public
static
string
LibNameType
=
"LibNameType"
;
/// <summary>
/// AOI文件路径
/// </summary>
public
static
string
AOIFileConfig
=
"AOIFileConfig"
;
//public static string Config_Pwd = "Config_Pwd";
...
...
@@ -130,25 +154,6 @@ namespace TSA_V.Common
public
static
string
DefaultPointType
=
"DefaultPointType"
;
public
static
string
Line_HomeWidth
=
"Line_HomeWidth"
;
public
static
string
Line_ChangeValue
=
"Line_ChangeValue"
;
public
static
string
Line_NodeAddr
=
"Line_NodeAddr"
;
public
static
string
Line_LastWidth
=
"Line_LastWidth"
;
public
static
string
Line_WidthPosition
=
"Line_WidthPosition"
;
public
static
string
Line_HomeSpeed
=
"Line_HomeSpeed"
;
public
static
string
Line_HomeStartSpeed
=
"Line_HomeStartSpeed"
;
public
static
string
Line_HomeStopSpeed
=
"Line_HomeStopSpeed"
;
public
static
string
Line_MicroStepping
=
"Line_MicroStepping"
;
public
static
string
Line_MaxSpeed
=
"Line_MaxSpeed"
;
public
static
string
Line_StartSpeed
=
"Line_StartSpeed"
;
public
static
string
Line_StopSpeed
=
"Line_StopSpeed"
;
public
static
string
Line_AddSpeed
=
"Line_AddSpeed"
;
public
static
string
Line_DelSpeed
=
"Line_DelSpeed"
;
public
static
string
Line_MaxPhaseCurrent
=
"Line_MaxPhaseCurrent"
;
public
static
string
Line_DelPhaseCurrent
=
"Line_DelPhaseCurrent"
;
public
static
string
Server_Log_Open
=
"Server_Log_Open"
;
public
static
string
DCSServerAddr
=
"DCSServerAddr"
;
...
...
Common/Setting_NInit.cs
查看文件 @
4397436
...
...
@@ -2,205 +2,244 @@
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Security.Cryptography
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
namespace
TSA_V.Common
{
public
class
Setting_NInit
{
[
MyConfigComment
(
"程序开机自启动"
)]
public
static
MyConfig
<
bool
>
App_AutoRun
=
false
;
/// <summary>
/// 系统主界面标题
/// </summary>
public
static
string
App_Title
=
"App_Title"
;
public
static
string
Board_ConfigPath
=
"Board_ConfigPath"
;
public
static
string
Position_Config
=
"Position_Config"
;
public
static
string
Position_Config_Label
=
"Position_Config_Label"
;
public
static
string
ComPath_Config
=
"ComPath_Config"
;
/// <summary>
/// 保存图片地址
/// </summary>
public
static
string
BOARD_IMAGE_PATH
=
"Board_Image_Path"
;
/// <summary>
/// 默认图片
/// </summary>
public
static
string
BOARD_IMAGE_DEFAULT
=
"BOARD_IMAGE_DEFAULT"
;
/// <summary>
/// 康奈德Ip配置
/// </summary>
public
static
string
IO_IP
=
"IO_IP"
;
public
static
string
IO_Port
=
"IO_Port"
;
public
static
string
Default_BoardID
=
"Default_BoardID"
;
/// <summary>
/// IP地址
/// </summary>
public
static
string
PUSICAN_Ip
=
"PUSICAN_Ip"
;
/// <summary>
/// 端口号
/// </summary>
public
static
string
PUSICAN_Port
=
"PUSICAN_Port"
;
public
static
string
PUSICAN_Position
=
"PUSICAN_Position"
;
public
static
string
RotateNode_MicroStepping
=
"RotateNode_MicroStepping"
;
public
static
string
RotateNode_MaxSpeed
=
"RotateNode_MaxSpeed"
;
public
static
string
RotateNode_StartSpeed
=
"RotateNode_StartSpeed"
;
public
static
string
RotateNode_StopSpeed
=
"RotateNode_StopSpeed"
;
public
static
string
RotateNode_AddSpeed
=
"RotateNode_AddSpeed"
;
public
static
string
RotateNode_DelSpeed
=
"RotateNode_DelSpeed"
;
public
static
string
RotateNode_MaxPhaseCurrent
=
"RotateNode_MaxPhaseCurrent"
;
public
static
string
RotateNode_DelPhaseCurrent
=
"RotateNode_DelPhaseCurrent"
;
public
static
string
RotateNode_HomeSpeed
=
"RotateNode_HomeSpeed"
;
public
static
string
RotateNode_HomeStartSpeed
=
"RotateNode_HomeStartSpeed"
;
public
static
string
RotateNode_HomeStopSpeed
=
"RotateNode_HomeStopSpeed"
;
/// <summary>
/// 料盘旋转轴
/// </summary>
public
static
string
RNode_Addr
=
"RNode_Addr"
;
/// <summary>
/// 元器件库的数量,=1表示有一个五层的料库
/// </summary>
public
static
string
TSAV_Storage_Count
=
"TSAV_Storage_Count"
;
/// <summary>
/// 旋转轴(库位轴)默认的位置
/// </summary>
public
static
string
RotateNode_DefaultPosition
=
"RotateNode_DefaultPosition"
;
/// <summary>
/// 元器件信息模板
/// </summary>
public
static
string
Componet_Template
=
"Componet_Template"
;
public
static
string
Default_Language
=
"Default_Language"
;
public
static
string
AuToSoldering_FilePath
=
"AuToSoldering_FilePath"
;
public
static
string
IsDebug
=
"IsDebug"
;
// public static string XAxis_Change = "XAxis_Change";
//public static string XAxis_MaxValue = "XAxis_MaxValue";
//public static string XAxis_MinValue = "XAxis_MinValue";
//public static string YAxis_Change = "YAxis_Change";
//public static string YAxis_MaxValue = "YAxis_MaxValue";
//public static string YAxis_MinValue = "YAxis_MinValue";
public
static
string
SolderingLedIP
=
"SolderingLedIP"
;
public
static
string
SolderingLedIndex
=
"SolderingLedIndex"
;
public
static
string
CameraName
=
"CameraName"
;
/// <summary>
/// 是否需要进行AOI检测
/// </summary>
public
static
string
IsNeedAOI
=
"IsNeedAOI"
;
/// <summary>
/// 工作模式
/// </summary>
public
static
string
WorkMode
=
"WorkMode"
;
/// <summary>
/// 自动工作间隔
/// </summary>
public
static
string
AuToModeSeconds
=
"AuToModeSeconds"
;
public
static
string
WorkCount_ConfigPath
=
"WorkCount_ConfigPath"
;
public
static
string
IsNeedCount
=
"IsNeedCount"
;
public
static
string
UseAIOBOX
=
"UseAIOBOX"
;
/// <summary>
/// 元器件库名称的类型,0=英文,1=中文
/// </summary>
public
static
string
LibNameType
=
"LibNameType"
;
/// <summary>
/// AOI文件路径
/// </summary>
public
static
string
AOIFileConfig
=
"AOIFileConfig"
;
//public static string Config_Pwd = "Config_Pwd";
public
static
string
DefaultPointSize
=
"DefaultPointSize"
;
public
static
string
DefaultPointType
=
"DefaultPointType"
;
public
static
string
Line_HomeWidth
=
"Line_HomeWidth"
;
public
static
string
Line_ChangeValue
=
"Line_ChangeValue"
;
public
static
string
Line_NodeAddr
=
"Line_NodeAddr"
;
public
static
string
Line_LastWidth
=
"Line_LastWidth"
;
public
static
string
Line_WidthPosition
=
"Line_WidthPosition"
;
public
static
string
Line_HomeSpeed
=
"Line_HomeSpeed"
;
public
static
string
Line_HomeStartSpeed
=
"Line_HomeStartSpeed"
;
public
static
string
Line_HomeStopSpeed
=
"Line_HomeStopSpeed"
;
public
static
string
Line_MicroStepping
=
"Line_MicroStepping"
;
public
static
string
Line_MaxSpeed
=
"Line_MaxSpeed"
;
public
static
string
Line_StartSpeed
=
"Line_StartSpeed"
;
public
static
string
Line_StopSpeed
=
"Line_StopSpeed"
;
public
static
string
Line_AddSpeed
=
"Line_AddSpeed"
;
public
static
string
Line_DelSpeed
=
"Line_DelSpeed"
;
public
static
string
Line_MaxPhaseCurrent
=
"Line_MaxPhaseCurrent"
;
public
static
string
Line_DelPhaseCurrent
=
"Line_DelPhaseCurrent"
;
public
static
string
Server_Log_Open
=
"Server_Log_Open"
;
public
static
string
DCSServerAddr
=
"DCSServerAddr"
;
public
static
string
WebServiceAddr
=
"WebServiceAddr"
;
/// <summary>
/// 是否需要输入pcb条码
/// </summary>
public
static
string
NeedPCBCode
=
"NeedPCBCode"
;
public
static
string
DisableSideCylinder
=
"DisableSideCylinder"
;
public
static
string
DisableBottomCylinder
=
"DisableBottomCylinder"
;
public
static
string
IsCycleDebug
=
"IsCycleDebug"
;
public
static
string
SideCylinderMoveFirst
=
"SideCylinderMoveFirst"
;
public
static
string
WorkSingleStart
=
"WorkSingleStart"
;
public
static
string
OfflineMode
=
"OfflineMode"
;
public
static
string
PointDisplayType
=
"PointDisplayType"
;
/// <summary>
/// 运行中断程序名称
/// </summary>
public
static
string
ProcedureName
=
"ProcedureName"
;
/// <summary>
/// 位号
/// </summary>
public
static
string
TagNumber
=
"TagNumber"
;
/// <summary>
/// 禁用继续未完成程序功能
/// </summary>
public
static
string
DisContinueWorking
=
"DisContinueWorking"
;
public
static
string
DisShowScreenAlarm
=
"DisShowScreenAlarm"
;
///// <summary>
///// 实时播放视频所在屏幕索引号
///// </summary>
//public static string VideoFrom_Index = "VideoFrom_Index";
//public static string VideoForm_Show = "VideoForm_Show";
/// <summary>
/// 投影屏幕索引,默认1
/// </summary>
public
static
string
ProjectorScreen_Index
=
"ProjectorScreen_Index"
;
[
MyConfigComment
(
"1时自动启动,并隐藏窗口,=0时不需要"
)]
public
static
MyConfig
<
bool
>
App_AutoRun
=
true
;
[
MyConfigComment
(
"系统主界面标题"
)]
public
static
MyConfig
<
string
>
App_App_Title
=
"SmartWorkstation"
;
[
MyConfigComment
(
"IO模块IP"
)]
public
static
MyConfig
<
string
>
Device_IO_IP
=
"192.168.200.11"
;
[
MyConfigComment
(
"IO模块端口号"
)]
public
static
MyConfig
<
int
>
Device_IO_Port
=
502
;
[
MyConfigComment
(
"默认语言"
)]
public
static
MyConfig
<
string
>
App_Default_Language
=
"zh-CN"
;
[
MyConfigComment
(
"是否调试状态"
)]
public
static
MyConfig
<
bool
>
App_IsDebug
=
true
;
[
MyConfigComment
(
"是否需要进行AOI检测"
)]
public
static
MyConfig
<
bool
>
Work_IsNeedAOI
=
false
;
[
MyConfigComment
(
"工作模式"
)]
public
static
MyConfig
<
int
>
Work_WorkMode
=
0
;
[
MyConfigComment
(
"自动工作间隔"
)]
public
static
MyConfig
<
int
>
Work_AuToModeSeconds
=
5
;
[
MyConfigComment
(
"是否需要统计"
)]
public
static
MyConfig
<
bool
>
Work_IsNeedCount
=
true
;
[
MyConfigComment
(
" IO模块 0=康耐得 1=零点 2=南京实点 3=泥人科技,无线体"
)]
public
static
MyConfig
<
int
>
Work_IOType
=
2
;
[
MyConfigComment
(
"元器件库名称的类型,0=英文,1=中文"
)]
public
static
MyConfig
<
int
>
Work_LibNameType
=
1
;
[
MyConfigComment
(
"相机名称"
)]
public
static
MyConfig
<
string
>
Device_CameraName
=
""
;
[
MyConfigComment
(
"投影点默认尺寸"
)]
public
static
MyConfig
<
int
>
Device_DefaultPointSize
=
5
;
[
MyConfigComment
(
"投影点默认类型"
)]
public
static
MyConfig
<
int
>
Device_DefaultPointType
=
1
;
[
MyConfigComment
(
"投影屏幕索引,默认1"
)]
public
static
MyConfig
<
int
>
Device_ProjectorScreen_Index
=
1
;
[
MyConfigComment
(
"显示通信日志"
)]
public
static
MyConfig
<
bool
>
App_Server_Log_Open
=
false
;
[
MyConfigComment
(
"本地开放的http服务器端口号"
)]
public
static
MyConfig
<
string
>
App_DCSServerAddr
=
"DCSServerAddr"
;
[
MyConfigComment
(
"组装完成后上传数据的服务器地址"
)]
public
static
MyConfig
<
string
>
App_WebServiceAddr
=
"WebServiceAddr"
;
[
MyConfigComment
(
"是否需要输入pcb条码"
)]
public
static
MyConfig
<
bool
>
Device_NeedPCBCode
=
false
;
[
MyConfigComment
(
"是否禁用侧挡气缸"
)]
public
static
MyConfig
<
bool
>
Device_DisableSideCylinder
=
true
;
[
MyConfigComment
(
"是否禁用底部气缸"
)]
public
static
MyConfig
<
bool
>
Device_DisableBottomCylinder
=
true
;
[
MyConfigComment
(
"是否循环测试"
)]
public
static
MyConfig
<
bool
>
Device_IsCycleDebug
=
false
;
[
MyConfigComment
(
"侧挡气缸是否先移动"
)]
public
static
MyConfig
<
bool
>
Device_SideCylinderMoveFirst
=
true
;
[
MyConfigComment
(
"是否工作区域启动"
)]
public
static
MyConfig
<
bool
>
Work_WorkSingleStart
=
false
;
[
MyConfigComment
(
"是否离线模式"
)]
public
static
MyConfig
<
bool
>
Work_OfflineMode
=
false
;
[
MyConfigComment
(
"点位显示:优先使用位号"
)]
public
static
MyConfig
<
int
>
Work_PointDisplayType
=
1
;
[
MyConfigComment
(
"最后一次中断的程序名称"
)]
public
static
MyConfig
<
string
>
Work_ProcedureName
=
""
;
[
MyConfigComment
(
"最后一次工作的位号"
)]
public
static
MyConfig
<
int
>
Work_TagNumber
=
0
;
[
MyConfigComment
(
"禁用继续未完成程序功能"
)]
public
static
MyConfig
<
bool
>
Work_DisContinueWorking
=
true
;
[
MyConfigComment
(
"禁用投影屏幕显示报警"
)]
public
static
MyConfig
<
bool
>
Work_DisShowScreenAlarm
=
true
;
[
MyConfigComment
(
"软件配置是否需要迁移"
)]
public
static
MyConfig
<
bool
>
Soft_NeedChangeConfig
=
true
;
[
MyConfigComment
(
"软件配置迁移完成"
)]
public
static
MyConfig
<
bool
>
Soft_ChangeOk
=
false
;
[
MyConfigComment
(
"调宽配置:电机回原点后的宽度"
)]
public
static
MyConfig
<
int
>
Line_HomeWidth
=
508
;
[
MyConfigComment
(
"调宽配置:宽度转换系数,1mm对应的电机位置"
)]
public
static
MyConfig
<
int
>
Line_ChangeValue
=
200
;
[
MyConfigComment
(
"调宽配置:调宽伺服地址"
)]
public
static
MyConfig
<
int
>
Line_NodeAddr
=
11
;
[
MyConfigComment
(
"流水线最后一次调的宽度"
)]
public
static
MyConfig
<
int
>
Line_LastWidth
=
400
;
[
MyConfigComment
(
"宽度对应位置配置"
)]
public
static
MyConfig
<
string
>
Line_WidthPosition
=
""
;
[
MyConfigComment
(
"服务器地址"
)]
public
static
MyConfig
<
string
>
App_Server
=
""
;
[
MyConfigComment
(
"Cid"
)]
public
static
MyConfig
<
string
>
App_Cid
=
""
;
public
static
void
ChangeConfig
()
{
try
{
//配置迁移
if
(!
Soft_NeedChangeConfig
)
{
LogUtil
.
info
(
"不需要迁移配置,直接返回"
);
return
;
}
if
(
Soft_ChangeOk
.
Val
)
{
LogUtil
.
info
(
"已迁移过配置,直接返回"
);
return
;
}
App_Server
=
ConfigAppSettings
.
GetValue
(
"SMF_Serverurl"
,
App_Server
);
App_Cid
=
ConfigAppSettings
.
GetValue
(
"SMF_CID"
,
App_Cid
);
Device_ProjectorScreen_Index
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
ProjectorScreen_Index
,
Device_ProjectorScreen_Index
);
Work_DisShowScreenAlarm
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
DisShowScreenAlarm
,
Work_DisShowScreenAlarm
);
Work_DisContinueWorking
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
DisContinueWorking
);
Work_TagNumber
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TagNumber
,
Work_TagNumber
);
Work_ProcedureName
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
ProcedureName
,
Work_ProcedureName
);
Work_PointDisplayType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
PointDisplayType
,
Work_PointDisplayType
);
Work_OfflineMode
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
OfflineMode
,
Work_OfflineMode
);
Work_WorkSingleStart
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
WorkSingleStart
,
Work_WorkSingleStart
);
Device_SideCylinderMoveFirst
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
SideCylinderMoveFirst
,
Device_SideCylinderMoveFirst
);
Device_IsCycleDebug
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsCycleDebug
,
Device_IsCycleDebug
);
Device_DisableBottomCylinder
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
DisableBottomCylinder
,
Device_DisableBottomCylinder
);
Device_DisableSideCylinder
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
DisableSideCylinder
,
Device_DisableSideCylinder
);
Device_NeedPCBCode
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
NeedPCBCode
,
Device_NeedPCBCode
);
App_WebServiceAddr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
WebServiceAddr
,
App_WebServiceAddr
);
App_DCSServerAddr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DCSServerAddr
,
App_DCSServerAddr
);
App_Server_Log_Open
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
Server_Log_Open
,
App_Server_Log_Open
);
Device_DefaultPointType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultPointType
,
Device_DefaultPointType
);
Device_DefaultPointSize
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultPointSize
,
Device_DefaultPointSize
);
Work_IOType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseAIOBOX
,
Work_IOType
);
Work_IsNeedCount
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsNeedCount
,
Work_IsNeedCount
);
Work_AuToModeSeconds
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
AuToModeSeconds
,
Work_AuToModeSeconds
);
Work_WorkMode
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
WorkMode
,
Work_WorkMode
);
Work_IsNeedAOI
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsNeedAOI
,
Work_IsNeedAOI
);
Device_CameraName
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
,
Device_CameraName
);
App_IsDebug
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsDebug
,
App_IsDebug
);
Device_IO_Port
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
IO_Port
,
Device_IO_Port
);
Device_IO_IP
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
IO_IP
,
Device_IO_IP
);
App_App_Title
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_Title
,
App_App_Title
);
App_AutoRun
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
App_AutoRun
,
App_AutoRun
);
App_Default_Language
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Default_Language
,
App_Default_Language
);
Line_ChangeValue
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_ChangeValue
,
Line_ChangeValue
);
Line_HomeWidth
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_HomeWidth
,
Line_HomeWidth
);
Line_NodeAddr
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_NodeAddr
,
Line_NodeAddr
);
Line_LastWidth
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_LastWidth
,
Line_LastWidth
);
Line_WidthPosition
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Line_WidthPosition
,
Line_WidthPosition
);
Soft_NeedChangeConfig
=
true
;
Soft_ChangeOk
=
true
;
LogUtil
.
info
(
" 配置迁移完成, 备份并删除原来配置"
);
ConfigAppSettings
.
BackFile
();
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
ProjectorScreen_Index
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
DisShowScreenAlarm
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
DisContinueWorking
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
TagNumber
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
ProcedureName
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
PointDisplayType
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
OfflineMode
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
WorkSingleStart
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
SideCylinderMoveFirst
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
IsCycleDebug
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
DisableBottomCylinder
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
DisableSideCylinder
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
NeedPCBCode
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
WebServiceAddr
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
DCSServerAddr
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
Server_Log_Open
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
DefaultPointType
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
DefaultPointSize
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
UseAIOBOX
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
IsNeedCount
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
AuToModeSeconds
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
WorkMode
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
IsNeedAOI
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
CameraName
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
IsDebug
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
IO_Port
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
IO_IP
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
App_Title
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
App_AutoRun
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
Default_Language
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
Line_ChangeValue
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
Line_HomeWidth
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
Line_NodeAddr
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
Line_LastWidth
);
ConfigAppSettings
.
RemoveKey
(
Setting_Init
.
Line_WidthPosition
);
ConfigAppSettings
.
RemoveKey
(
"SMF_Serverurl"
);
ConfigAppSettings
.
RemoveKey
(
"SMF_CID"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"配置迁移出错:"
+
ex
.
ToString
());
}
}
}
}
Common/util/ConfigAppSettings.cs
查看文件 @
4397436
...
...
@@ -7,6 +7,10 @@ using System.Threading;
using
System.Xml
;
using
System.Windows.Forms
;
using
log4net
;
using
System.IO
;
using
System.Diagnostics
;
using
Newtonsoft.Json.Linq
;
using
System.Xml.Linq
;
namespace
TSA_V.Common
{
...
...
@@ -27,19 +31,19 @@ namespace TSA_V.Common
Interlocked
.
Increment
(
ref
seq
);
return
seq
;
}
public
static
string
GetValue
(
string
keyStr
,
string
storeStr
)
{
string
key
=
keyStr
+
storeStr
;
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
{
return
GetValue
(
keyStr
);
}
else
{
return
config
.
AppSettings
.
Settings
[
key
].
Value
;
}
}
//
public static string GetValue(string keyStr, string storeStr)
//
{
//
string key = keyStr + storeStr;
//
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
//
if (config.AppSettings.Settings[key] == null)
//
{
//
return GetValue(keyStr);
//
}
//
else
//
{
//
return config.AppSettings.Settings[key].Value;
//
}
//
}
public
static
decimal
GetNumValue
(
string
keyStr
,
string
storeStr
)
{
...
...
@@ -81,7 +85,7 @@ namespace TSA_V.Common
{
return
(
uint
)
GetIntValue
(
keyStr
);
}
public
static
bool
GetBoolValue
(
string
keyStr
)
public
static
bool
GetBoolValue
(
string
keyStr
,
bool
defv
=
false
)
{
return
GetIntValue
(
keyStr
).
Equals
(
1
);
}
...
...
@@ -90,13 +94,13 @@ namespace TSA_V.Common
{
return
(
uint
)
GetIntValue
(
keyStr
,
storeStr
);
}
public
static
string
GetValue
(
string
key
)
public
static
string
GetValue
(
string
key
,
string
defValue
=
""
)
{
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
{
LOGGER
.
Error
(
"未找到配置:"
+
key
+
",请检查配置是否完整!"
);
return
""
;
return
defValue
;
}
else
{
...
...
@@ -144,112 +148,150 @@ namespace TSA_V.Common
}
}
return
a
;
}
public
static
void
SaveValue
(
string
key
,
bool
value
)
{
if
(
value
)
{
SaveValue
(
key
,
1.
ToString
());
}
else
{
SaveValue
(
key
,
0.
ToString
());
}
}
public
static
void
SaveValue
(
string
key
,
double
value
)
{
//
public static void SaveValue(string key, bool value)
//
{
//
if (value)
//
{
//
SaveValue(key, 1.ToString());
//
}
//
else
//
{
//
SaveValue(key, 0.ToString());
//
}
//
}
//
public static void SaveValue(string key, double value)
//
{
SaveValue
(
key
,
value
.
ToString
());
}
public
static
void
SaveValue
(
string
key
,
int
value
)
{
SaveValue
(
key
,
value
.
ToString
());
}
public
static
void
SaveValue
(
string
key
,
string
value
)
{
// SaveValue(key, value.ToString());
//}
//public static void SaveValue(string key, int value)
//{
// SaveValue(key, value.ToString());
//}
//public static void SaveValue(string key, string value)
//{
// try
// {
// if (key.Equals("") || value.Equals(""))
// {
// return;
// }
// //增加的内容写在appSettings段下 <add key="RegCode" value="0"/>
// System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// if (config.AppSettings.Settings[key] == null)
// {
// SetValue(key, value);
// }
// else
// {
// UpdateConfig(key, value);
// }
// }
// catch (Exception ex)
// {
// LogUtil.error(LOGGER, "SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + "," + ex.StackTrace);
// }
//}
///// <summary>
///// 更新配置文件信息
///// </summary>
///// <param name="name">配置文件字段名称</param>
///// <param name="Xvalue">值</param>
//private static void UpdateConfig(string name, string Xvalue)
//{
// try
// {
// XmlDocument doc = new XmlDocument();
// doc.Load(Application.ExecutablePath + ".config");
// XmlNode node = doc.SelectSingleNode(@"//add[@key='" + name + "']");
// XmlElement ele = (XmlElement)node;
// ele.SetAttribute("value", Xvalue);
// doc.Save(Application.ExecutablePath + ".config");
// }
// catch (Exception ex)
// {
// LogUtil.error(LOGGER, "UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + "," + ex.StackTrace);
// }
//}
/////<summary>
/////向.config文件的appKey结写入信息AppValue 保存设置
/////</summary>
/////<param name="AppKey">节点名</param>
/////<param name="AppValue">值</param>
//private static void SetValue(String AppKey, String AppValue)
//{
// try
// {
// XmlDocument xDoc = new XmlDocument();
// xDoc.Load(System.Windows.Forms.Application.ExecutablePath + ".config");
// XmlNode xNode;
// XmlElement xElem1;
// XmlElement xElem2;
// xNode = xDoc.SelectSingleNode("//appSettings");
// xElem1 = (XmlElement)xNode.SelectSingleNode("//add[@key='" + AppKey + "']");
// if (xElem1 != null)
// xElem1.SetAttribute("value", AppValue);
// else
// {
// xElem2 = xDoc.CreateElement("add");
// xElem2.SetAttribute("key", AppKey);
// xElem2.SetAttribute("value", AppValue);
// xNode.AppendChild(xElem2);
// }
// xDoc.Save(System.Windows.Forms.Application.ExecutablePath + ".config");
// }
// catch (Exception ex)
// {
// LogUtil.error(LOGGER, "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace);
// }
//}
//public static void UpdateAppSetting(string key, string value)
//{
// SaveValue(key, value);
//}
public
static
void
BackFile
()
{
//备份文件
//备份保存
try
{
if
(
key
.
Equals
(
""
)
||
value
.
Equals
(
""
))
{
return
;
}
//增加的内容写在appSettings段下 <add key="RegCode" value="0"/>
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
string
date
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
);
string
targetBackPath
=
@"C:\configBack\" + date + @"
\
";
if
(!
Directory
.
Exists
(
targetBackPath
))
{
SetValue
(
key
,
value
);
Directory
.
CreateDirectory
(
targetBackPath
);
}
else
string
fileName
=
Process
.
GetCurrentProcess
().
ProcessName
+
".exe.config"
;
string
backFile
=
targetBackPath
+
fileName
;
if
(
File
.
Exists
(
backFile
))
{
UpdateConfig
(
key
,
valu
e
);
File
.
Delete
(
backFil
e
);
}
File
.
Copy
(
fileName
,
backFile
,
true
);
}
catch
(
Exception
e
x
)
catch
(
Exception
e
)
{
L
ogUtil
.
error
(
LOGGER
,
"SaveValue保存配置出错:AppKey="
+
key
+
",AppValue="
+
value
+
","
+
ex
.
StackTrac
e
);
L
OGGER
.
Error
(
$
"删除 appconfig 前备份出错:"
,
e
);
}
}
/// <summary>
/// 更新配置文件信息
/// </summary>
/// <param name="name">配置文件字段名称</param>
/// <param name="Xvalue">值</param>
private
static
void
UpdateConfig
(
string
name
,
string
Xvalue
)
public
static
void
RemoveKey
(
string
keyName
)
{
try
{
XmlDocument
doc
=
new
XmlDocument
();
doc
.
Load
(
Application
.
ExecutablePath
+
".config"
);
XmlNode
node
=
doc
.
SelectSingleNode
(
@"//add[@key='"
+
name
+
"']"
);
XmlElement
ele
=
(
XmlElement
)
node
;
ele
.
SetAttribute
(
"value"
,
Xvalue
);
doc
.
Save
(
Application
.
ExecutablePath
+
".config"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"UpdateConfig保存配置出错:name="
+
name
+
",Xvalue="
+
Xvalue
+
","
+
ex
.
StackTrace
);
}
}
///<summary>
///向.config文件的appKey结写入信息AppValue 保存设置
///</summary>
///<param name="AppKey">节点名</param>
///<param name="AppValue">值</param>
private
static
void
SetValue
(
String
AppKey
,
String
AppValue
)
{
try
{
XmlDocument
xDoc
=
new
XmlDocument
();
xDoc
.
Load
(
System
.
Windows
.
Forms
.
Application
.
ExecutablePath
+
".config"
);
XmlNode
xNode
;
XmlElement
xElem1
;
XmlElement
xElem2
;
xNode
=
xDoc
.
SelectSingleNode
(
"//appSettings"
);
xElem1
=
(
XmlElement
)
xNode
.
SelectSingleNode
(
"//add[@key='"
+
AppKey
+
"']"
);
if
(
xElem1
!=
null
)
xElem1
.
SetAttribute
(
"value"
,
AppValue
);
else
{
xElem2
=
xDoc
.
CreateElement
(
"add"
);
xElem2
.
SetAttribute
(
"key"
,
AppKey
);
xElem2
.
SetAttribute
(
"value"
,
AppValue
);
xNode
.
AppendChild
(
xElem2
);
}
xDoc
.
Save
(
System
.
Windows
.
Forms
.
Application
.
ExecutablePath
+
".config"
);
//删除配置文件键为keyName的项
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
config
.
AppSettings
.
Settings
.
Remove
(
keyName
);
config
.
Save
(
ConfigurationSaveMode
.
Modified
);
ConfigurationManager
.
RefreshSection
(
"appSettings"
);
LogUtil
.
error
(
$
"删除 appconfig [{keyName}] 完成"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"SetValue保存配置出错:AppKey="
+
AppKey
+
",AppValue="
+
AppValue
+
","
+
ex
.
StackTrace
);
}
LogUtil
.
error
(
$
"删除 appconfig [{keyName}] 出错:"
+
ex
.
ToString
());
}
public
static
void
UpdateAppSetting
(
string
key
,
string
value
)
{
SaveValue
(
key
,
value
);
//Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
//configuration.AppSettings.Settings[key].Value = value;
//configuration.Save(ConfigurationSaveMode.Modified);
//ConfigurationManager.RefreshSection("appSettings");
}
}
}
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
4397436
...
...
@@ -38,6 +38,7 @@
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, PublicKeyToken=null" />
<Reference Include="ExcelDataReader, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>..\packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll</HintPath>
</Reference>
...
...
DeviceLibrary/bean/BoardInfo.cs
查看文件 @
4397436
...
...
@@ -332,7 +332,7 @@ namespace TSA_V.DeviceLibrary
public
string
GetDisplayStr
()
{
string
text
=
PN
;
if
(
BoardManager
.
PointDisplayType
.
Equals
(
1
))
if
(
Setting_NInit
.
Work_
PointDisplayType
.
Equals
(
1
))
{
text
=
TagNo
;
}
...
...
DeviceLibrary/csvLoad/CSVReaderBase.cs
查看文件 @
4397436
...
...
@@ -14,7 +14,7 @@ namespace TSA_V.LoadCSVLibrary
{
public
static
char
Spilt_Char
=
','
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
private
static
int
LibNameType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
LibNameType
);
//
private static int LibNameType = ConfigAppSettings.GetIntValue(Setting_Init.LibNameType);
public
static
Dictionary
<
string
,
string
>
getProAttributeMap
(
Type
type
)
{
...
...
DeviceLibrary/deviceLibrary/IO/IOBase.cs
查看文件 @
4397436
...
...
@@ -24,7 +24,8 @@ namespace TSA_V.DeviceLibrary
public
static
void
Init
()
{
int
isAIOBox
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseAIOBOX
);
//int isAIOBox = ConfigAppSettings.GetIntValue(Setting_Init.UseAIOBOX);
int
isAIOBox
=
Setting_NInit
.
Work_IOType
;
if
(
isAIOBox
==
1
)
{
instance
=
new
AIOBOXManager
();
...
...
DeviceLibrary/deviceLibrary/IO/IOManager.cs
查看文件 @
4397436
...
...
@@ -35,8 +35,8 @@ namespace TSA_V.DeviceLibrary
public
static
void
InitData
()
{
KNDIP
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
IO_IP
)
;
KNDPort
=
(
ushort
)
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
IO_Port
)
;
KNDIP
=
Setting_NInit
.
Device_IO_IP
;
KNDPort
=
(
ushort
)
Setting_NInit
.
Device_IO_Port
;
byte
slaveId
=
(
byte
)
0
;
IOBase
.
Init
();
builder
=
new
StringBuilder
(
"\r\n"
);
...
...
DeviceLibrary/manager/BoardManager.cs
查看文件 @
4397436
...
...
@@ -16,7 +16,7 @@ namespace TSA_V.DeviceLibrary
{
public
class
BoardManager
{
public
static
int
PointDisplayType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
PointDisplayType
);
//
public static int PointDisplayType = ConfigAppSettings.GetIntValue(Setting_Init.PointDisplayType);
private
static
int
MaxId
=
0
;
/// <summary>
/// 板子列表
...
...
DeviceLibrary/manager/LineWidthManager.cs
查看文件 @
4397436
...
...
@@ -15,11 +15,11 @@ namespace TSA_V.DeviceLibrary
/// </summary>
public
class
LWidthManager
{
public
static
int
Line_ChangeValue
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_ChangeValue
)
;
public
static
int
Line_HomeWidth
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_HomeWidth
)
;
public
static
uint
Line_NodeAddr
=(
uint
)
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_NodeAddr
);
public
static
int
Line_LastWidth
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_LastWidth
)
;
private
static
string
Line_WidthPosition
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Line_WidthPosition
)
;
public
static
int
Line_ChangeValue
=
Setting_NInit
.
Line_ChangeValue
;
public
static
int
Line_HomeWidth
=
Setting_NInit
.
Line_HomeWidth
;
public
static
uint
Line_NodeAddr
=(
uint
)
(
Setting_NInit
.
Line_NodeAddr
.
Val
);
public
static
int
Line_LastWidth
=
Setting_NInit
.
Line_LastWidth
;
private
static
string
Line_WidthPosition
=
Setting_NInit
.
Line_WidthPosition
;
public
static
int
DefaultPosition
=
0
;
public
static
bool
LineInitOk
=
false
;
...
...
@@ -104,7 +104,7 @@ namespace TSA_V.DeviceLibrary
Line_LastWidth
=
targetWidth
;
DefaultPosition
=
targetPosition
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Line_LastWidth
,
Line_LastWidth
)
;
Setting_NInit
.
Line_LastWidth
=
Line_LastWidth
;
// PUSICANLibrary.PUSICANControl.AbsMove(Line_NodeAddr, targetPosition);
Stopwatch
stopwatch
=
new
Stopwatch
();
...
...
@@ -265,7 +265,7 @@ namespace TSA_V.DeviceLibrary
}
newStr
=
newStr
.
Substring
(
0
,
newStr
.
Length
-
1
);
Line_WidthPosition
=
newStr
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Line_WidthPosition
,
Line_WidthPosition
)
;
Setting_NInit
.
Line_WidthPosition
=
Line_WidthPosition
;
}
}
}
DeviceLibrary/manager/ProjectorProcess.cs
查看文件 @
4397436
...
...
@@ -21,7 +21,8 @@ namespace TSA_V
public
static
bool
AOIopen
=
false
;
public
static
bool
DisShowScreenAlarm
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
DisShowScreenAlarm
);
//public static bool DisShowScreenAlarm = ConfigAppSettings.GetBoolValue(Setting_Init.DisShowScreenAlarm);
public
static
bool
DisShowScreenAlarm
=
Setting_NInit
.
Work_DisShowScreenAlarm
;
private
static
System
.
Timers
.
Timer
proTimer
=
null
;
...
...
DeviceLibrary/manager/TSAVBean.cs
查看文件 @
4397436
...
...
@@ -14,14 +14,14 @@ namespace TSA_V.DeviceLibrary
{
public
partial
class
TSAVBean
{
public
static
bool
IsDebug
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsDebug
);
public
static
bool
SideCylinderMoveFirst
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
SideCylinderMoveFirst
);
//
public static bool IsDebug = ConfigAppSettings.GetBoolValue(Setting_Init.IsDebug);
//
public static bool SideCylinderMoveFirst = ConfigAppSettings.GetBoolValue(Setting_Init.SideCylinderMoveFirst);
public
static
string
Name
=
"MASCOT"
;
public
static
int
RotateNode_DefaultPosition
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
RotateNode_DefaultPosition
);
public
static
Dictionary
<
int
,
Dictionary
<
int
,
NodeInfo
>>
RotateMap
=
new
Dictionary
<
int
,
Dictionary
<
int
,
NodeInfo
>>();
public
static
int
DefaultPType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultPointType
);
public
static
int
DefaultPSize
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultPointSize
);
//
public static int DefaultPType = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointType);
//
public static int DefaultPSize = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointSize);
public
static
bool
DisableSideCylinder
=
false
;
public
static
bool
DisableBottomCylinder
=
false
;
...
...
@@ -46,7 +46,7 @@ namespace TSA_V.DeviceLibrary
/// <summary>
/// 工作模式,0=脚踏模式,1=自动模式
/// </summary>
public
static
int
WorkMode
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
WorkMode
)
;
public
static
int
WorkMode
=
Setting_NInit
.
Work_WorkMode
;
/// <summary>
/// 自动模式下,踩脚踏或按按钮, 自动模式暂停,界面显示暂停状态;再次踩脚踏或按按钮,退出暂停状态
...
...
@@ -57,7 +57,7 @@ namespace TSA_V.DeviceLibrary
public
static
int
AuToModeSeconds
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
AuToModeSeconds
)
;
public
static
int
AuToModeSeconds
=
Setting_NInit
.
Work_AuToModeSeconds
;
public
static
TSAVStatus
Status
=
TSAVStatus
.
Wait
;
public
static
ResetStep
resetStep
=
ResetStep
.
OpenCan_0
;
...
...
@@ -65,7 +65,7 @@ namespace TSA_V.DeviceLibrary
private
static
System
.
Timers
.
Timer
workTimer
=
null
;
public
static
WorkInfo
Work
=
new
WorkInfo
();
public
static
bool
IsNeedAOI
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsNeedAOI
)
;
public
static
bool
IsNeedAOI
=
Setting_NInit
.
Work_IsNeedAOI
;
public
static
bool
IsCanStepMove
=
false
;
public
static
int
LastStepIndex
=
4
;
...
...
@@ -84,8 +84,8 @@ namespace TSA_V.DeviceLibrary
public
static
string
LoadTSAV
()
{
LogUtil
.
info
(
Name
+
"开始加载电机配置。。"
);
DisableSideCylinder
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
DisableSideCylinder
)
;
DisableBottomCylinder
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
DisableBottomCylinder
)
;
DisableSideCylinder
=
Setting_NInit
.
Device_DisableSideCylinder
;
DisableBottomCylinder
=
Setting_NInit
.
Device_DisableBottomCylinder
;
if
(
workTimer
==
null
)
{
workTimer
=
new
System
.
Timers
.
Timer
();
...
...
@@ -114,13 +114,13 @@ namespace TSA_V.DeviceLibrary
}
}
if
(
DefaultPType
<=
0
||
DefaultP
Type
>
5
)
if
(
Setting_NInit
.
Device_DefaultPointType
<=
0
||
Setting_NInit
.
Device_DefaultPoint
Type
>
5
)
{
DefaultP
Type
=
1
;
Setting_NInit
.
Device_DefaultPoint
Type
=
1
;
}
if
(
DefaultPSize
<=
0
||
DefaultP
Size
>
100
)
if
(
Setting_NInit
.
Device_DefaultPointSize
<=
0
||
Setting_NInit
.
Device_DefaultPoint
Size
>
100
)
{
DefaultP
Size
=
4
;
Setting_NInit
.
Device_DefaultPoint
Size
=
4
;
}
Task
.
Factory
.
StartNew
(
delegate
...
...
@@ -777,7 +777,7 @@ namespace TSA_V.DeviceLibrary
else
{
//自动模式
if
((
span
.
TotalSeconds
>
AuToModeSeconds
&&
IsDebug
)
if
((
span
.
TotalSeconds
>
AuToModeSeconds
&&
Setting_NInit
.
App_
IsDebug
)
||
(
span
.
TotalSeconds
>
AuToModeSeconds
&&
WorkMode
.
Equals
(
1
))
)
{
...
...
@@ -789,7 +789,7 @@ namespace TSA_V.DeviceLibrary
{
//脚踏模式
if
(
IsFootOk
||
(
span
.
TotalSeconds
>
AuToModeSeconds
&&
IsDebug
))
||
(
span
.
TotalSeconds
>
AuToModeSeconds
&&
Setting_NInit
.
App_
IsDebug
))
{
Work
.
MoveToNextPoint
(
true
);
}
...
...
@@ -807,7 +807,7 @@ namespace TSA_V.DeviceLibrary
{
if
(
Work
.
WorkType
.
Equals
(
2
))
{
if
(
IsFootOk
||
(
span
.
TotalSeconds
>
Work
.
currPoint
.
WeldTime
+
6
&&
IsDebug
if
(
IsFootOk
||
(
span
.
TotalSeconds
>
Work
.
currPoint
.
WeldTime
+
6
&&
Setting_NInit
.
App_
IsDebug
||
(
span
.
TotalSeconds
>
Work
.
currPoint
.
WeldTime
+
6
&&
WorkMode
.
Equals
(
1
))))
{
Work
.
MoveToNextPoint
(
true
);
...
...
@@ -815,7 +815,7 @@ namespace TSA_V.DeviceLibrary
}
else
if
(
Work
.
WorkType
.
Equals
(
3
))
{
if
(
IsFootOk
||
(
span
.
TotalSeconds
>
8
&&
IsDebug
if
(
IsFootOk
||
(
span
.
TotalSeconds
>
8
&&
Setting_NInit
.
App_
IsDebug
||
(
span
.
TotalSeconds
>
8
&&
WorkMode
.
Equals
(
1
))))
{
Work
.
MoveToNextPoint
(
true
);
...
...
DeviceLibrary/manager/TSAVBean_Partial.cs
查看文件 @
4397436
...
...
@@ -274,7 +274,7 @@ namespace TSA_V.DeviceLibrary
}
else
if
(
LineStep
.
IsStep
(
StepEnum
.
LS04_StopLine
))
{
if
(
SideCylinderMoveFirst
)
if
(
S
etting_NInit
.
Device_S
ideCylinderMoveFirst
)
{
LineStep
.
NextStep
(
StepEnum
.
LS05_SideCylindeMove
);
LineLog
(
"流水线转动:侧挡气缸先前进"
);
...
...
@@ -301,8 +301,8 @@ namespace TSA_V.DeviceLibrary
}
else
if
(
LineStep
.
IsStep
(
StepEnum
.
LS07_SideCylindeMove
))
{
bool
needCode
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
NeedPCBCode
);
if
(
need
Code
)
//
bool needCode = ConfigAppSettings.GetBoolValue(Setting_Init.NeedPCBCode);
if
(
Setting_NInit
.
Device_NeedPCB
Code
)
{
LineStep
.
NextStep
(
StepEnum
.
LS08_WaitCode
);
LineLog
(
"流水线转动:停止流水线,等待输入二维码"
);
...
...
DeviceLibrary/manager/WorkInfo.cs
查看文件 @
4397436
...
...
@@ -52,7 +52,7 @@ namespace TSA_V.DeviceLibrary
if
(
isContinue
)
{
LogUtil
.
info
(
"开始程序【"
+
boardInfo
.
boardName
+
"】的插件 , 继续之前的工作,索引号="
+
currIndex
);
currIndex
=
Con
figAppSettings
.
GetIntValue
(
Setting_Init
.
TagNumber
);
currIndex
=
Con
vert
.
ToInt32
(
Setting_NInit
.
Work_
TagNumber
);
isContinue
=
false
;
}
else
...
...
@@ -221,13 +221,21 @@ namespace TSA_V.DeviceLibrary
{
#
region
2023
-
10
-
31
添加
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
//记录运行过程的位号
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
currBoard
.
boardName
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
currIndex
.
ToString
());
if
(
currPoint
.
pointNum
==
1
)
//第一个位号不需要记录
////记录运行过程的位号
//ConfigAppSettings.UpdateAppSetting(Setting_Init.ProcedureName, currBoard.boardName);
//ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, currIndex.ToString());
//if (currPoint.pointNum == 1)//第一个位号不需要记录
//{
// ConfigAppSettings.UpdateAppSetting(Setting_Init.ProcedureName, "");
// ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, "");
//}
Setting_NInit
.
Work_ProcedureName
=
currBoard
.
boardName
;
Setting_NInit
.
Work_TagNumber
=
currIndex
;
if
(
currPoint
.
pointNum
==
1
)
{
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
""
)
;
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
""
)
;
Setting_NInit
.
Work_ProcedureName
=
currBoard
.
boardName
;
Setting_NInit
.
Work_TagNumber
=
currIndex
;
}
#
endregion
useComponets
.
Add
(
com
);
...
...
DeviceLibrary/mes/MesUtil.cs
查看文件 @
4397436
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.IO
;
using
System.Linq
;
using
System.Runtime.Serialization
;
using
System.Security.Policy
;
using
System.ServiceModel
;
using
System.ServiceModel.Activation
;
using
System.ServiceModel.Web
;
...
...
@@ -53,7 +54,8 @@ namespace TSA_V.DeviceLibrary
public
static
bool
Open
()
{
//获取状态:http://localhost:4090/rest/api/v1/station/status
string
url
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
WebServiceAddr
);
//string url = ConfigAppSettings.GetValue(Setting_Init.WebServiceAddr);
string
url
=
Setting_NInit
.
App_WebServiceAddr
;
if
(
String
.
IsNullOrEmpty
(
serverAddress
))
{
return
false
;
...
...
@@ -87,7 +89,7 @@ namespace TSA_V.DeviceLibrary
#
region
上传工作结果
public
static
string
serverAddress
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DCSServerAddr
)
;
public
static
string
serverAddress
=
Setting_NInit
.
App_DCSServerAddr
;
public
static
string
SendStatus
(
DeviceStatus
status
)
{
if
(
String
.
IsNullOrEmpty
(
serverAddress
))
...
...
DeviceLibrary/smf/MyWebClient.cs
查看文件 @
4397436
...
...
@@ -51,7 +51,7 @@ namespace TSA_V.Common
{
private
static
int
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Server_Log_Open
);
//
private static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
public
static
string
PostJson
(
string
url
,
Object
operation
,
bool
simulate
=
false
)
{
...
...
DeviceLibrary/smf/ServerCommunication.cs
查看文件 @
4397436
...
...
@@ -36,6 +36,9 @@ public class ServerCommunication : IDisposable
CID
=
ConfigAppSettings
.
GetValue
(
"SMF_CID"
,
DefaultCid
);
server
=
Setting_NInit
.
App_Server
;
CID
=
Setting_NInit
.
App_Cid
;
if
(
String
.
IsNullOrEmpty
(
CID
))
{
CID
=
DefaultCid
;
...
...
TSA-V/DataCalculate.cs
查看文件 @
4397436
...
...
@@ -64,11 +64,11 @@ namespace TSA_V
if
(
smtPoint
.
PointSizeX
<
1
||
smtPoint
.
PointSizeX
>
255
)
{
smtPoint
.
PointSizeX
=
TSAVBean
.
DefaultP
Size
;
smtPoint
.
PointSizeX
=
Setting_NInit
.
Device_DefaultPoint
Size
;
}
if
(
smtPoint
.
PointSizeY
<
1
||
smtPoint
.
PointSizeY
>
255
)
{
smtPoint
.
PointSizeY
=
TSAVBean
.
DefaultP
Size
;
smtPoint
.
PointSizeY
=
Setting_NInit
.
Device_DefaultPoint
Size
;
}
//smtPoint.PointSize = 4;
//smtPoint.NodePositionX = BPoint.NodePositionX - (BPoint.NodePositionX - APoint.NodePositionX) * (BPoint.PositionX - smtPoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
...
...
TSA-V/FrmChangeWidth.cs
查看文件 @
4397436
...
...
@@ -32,9 +32,9 @@ namespace TSA_V
private
List
<
int
>
widthList
=
new
List
<
int
>();
private
void
LoadData
()
{
numChangeValue
.
Value
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_ChangeValue
)
;
numHomeWidth
.
Value
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_HomeWidth
)
;
numSlv
.
Value
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_NodeAddr
)
;
numChangeValue
.
Value
=
Setting_NInit
.
Line_ChangeValue
;
numHomeWidth
.
Value
=
Setting_NInit
.
Line_HomeWidth
;
numSlv
.
Value
=
Setting_NInit
.
Line_NodeAddr
;
numTarget
.
Value
=
defaultWidth
;
txtTargetPosition
.
Text
=
(
defaultWidth
-
((
int
)
numHomeWidth
.
Value
))
*
((
int
)
numChangeValue
.
Value
)
+
""
;
LoadList
();
...
...
@@ -99,9 +99,9 @@ namespace TSA_V
int
homeWidth
=
(
int
)
numHomeWidth
.
Value
;
int
numChange
=
(
int
)
numChangeValue
.
Value
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Line_NodeAddr
,
slvAddr
)
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Line_ChangeValue
,
numChange
)
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Line_HomeWidth
,
homeWidth
)
;
Setting_NInit
.
Line_NodeAddr
=
slvAddr
;
Setting_NInit
.
Line_ChangeValue
=
numChange
;
Setting_NInit
.
Line_HomeWidth
=
homeWidth
;
LWidthManager
.
Line_NodeAddr
=
(
uint
)
slvAddr
;
LWidthManager
.
Line_HomeWidth
=
homeWidth
;
...
...
TSA-V/FrmDeviceConfig.Designer.cs
查看文件 @
4397436
...
...
@@ -29,6 +29,7 @@
private
void
InitializeComponent
()
{
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
lblconfigdetial
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
chbDisSideCylinder
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
chbDisBottomCylinder
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
chbISDebug
=
new
System
.
Windows
.
Forms
.
CheckBox
();
...
...
@@ -70,6 +71,7 @@
//
// groupBox1
//
this
.
groupBox1
.
Controls
.
Add
(
this
.
lblconfigdetial
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
chbDisSideCylinder
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
chbDisBottomCylinder
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
chbISDebug
);
...
...
@@ -81,6 +83,17 @@
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
Text
=
"其他参数"
;
//
// lblconfigdetial
//
this
.
lblconfigdetial
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lblconfigdetial
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblconfigdetial
.
Location
=
new
System
.
Drawing
.
Point
(
443
,
66
);
this
.
lblconfigdetial
.
Name
=
"lblconfigdetial"
;
this
.
lblconfigdetial
.
Size
=
new
System
.
Drawing
.
Size
(
91
,
23
);
this
.
lblconfigdetial
.
TabIndex
=
290
;
this
.
lblconfigdetial
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblconfigdetial
.
Click
+=
new
System
.
EventHandler
(
this
.
label2_Click
);
//
// chbDisSideCylinder
//
this
.
chbDisSideCylinder
.
AutoSize
=
true
;
...
...
@@ -513,5 +526,6 @@
private
System
.
Windows
.
Forms
.
Button
btnTest
;
private
System
.
Windows
.
Forms
.
CheckBox
chbDisSideCylinder
;
private
System
.
Windows
.
Forms
.
CheckBox
chbDisBottomCylinder
;
private
System
.
Windows
.
Forms
.
Label
lblconfigdetial
;
}
}
\ No newline at end of file
TSA-V/FrmDeviceConfig.cs
查看文件 @
4397436
...
...
@@ -42,7 +42,7 @@ namespace TSA_V
private
void
FrmLanguage_Load
(
object
sender
,
EventArgs
e
)
{
LanguageProcess
();
this
.
chbISDebug
.
Checked
=
TSAVBean
.
IsDebug
;
this
.
chbISDebug
.
Checked
=
Setting_NInit
.
App_
IsDebug
;
this
.
chbDisBottomCylinder
.
Checked
=
TSAVBean
.
DisableBottomCylinder
;
this
.
chbDisSideCylinder
.
Checked
=
TSAVBean
.
DisableSideCylinder
;
this
.
txtKNDIP
.
Text
=
IOManager
.
KNDIP
.
ToString
();
...
...
@@ -50,15 +50,15 @@ namespace TSA_V
LoadCom
();
SetScreen
();
cmbType
.
SelectedIndex
=
0
;
int
value
=
TSAVBean
.
DefaultP
Type
-
1
;
int
value
=
Setting_NInit
.
Device_DefaultPoint
Type
-
1
;
if
(
cmbBoardList
.
Items
.
Count
>
value
&&
value
>=
0
)
{
cmbBoardList
.
SelectedIndex
=
value
;
}
numSizeX
.
Text
=
TSAVBean
.
DefaultP
Size
.
ToString
();
numSizeY
.
Text
=
TSAVBean
.
DefaultP
Size
.
ToString
();
txtAddr
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DCSServerAddr
)
;
numSizeX
.
Text
=
Setting_NInit
.
Device_DefaultPoint
Size
.
ToString
();
numSizeY
.
Text
=
Setting_NInit
.
Device_DefaultPoint
Size
.
ToString
();
txtAddr
.
Text
=
Setting_NInit
.
App_DCSServerAddr
;
if
(
MesUtil
.
CodeISOk
&&
MesUtil
.
CurrPCBCode
!=
""
)
{
txtCode
.
Text
=
MesUtil
.
CurrPCBCode
;
...
...
@@ -110,21 +110,24 @@ namespace TSA_V
private
void
SaveData
()
{
bool
isDebug
=
chbISDebug
.
Checked
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
IsDebug
,
isDebug
);
TSAVBean
.
IsDebug
=
isDebug
;
//ConfigAppSettings.SaveValue(Setting_Init.IsDebug, isDebug);
Setting_NInit
.
App_IsDebug
=
isDebug
;
bool
disBottom
=
chbDisBottomCylinder
.
Checked
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DisableBottomCylinder
,
disBottom
);
//ConfigAppSettings.SaveValue(Setting_Init.DisableBottomCylinder,disBottom);
Setting_NInit
.
Device_DisableBottomCylinder
=
disBottom
;
TSAVBean
.
DisableBottomCylinder
=
disBottom
;
bool
disSide
=
chbDisSideCylinder
.
Checked
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DisableSideCylinder
,
disSide
);
//ConfigAppSettings.SaveValue(Setting_Init.DisableSideCylinder, disSide);
Setting_NInit
.
Device_DisableSideCylinder
=
disSide
;
TSAVBean
.
DisableSideCylinder
=
disSide
;
string
server
=
txtAddr
.
Text
.
Trim
();
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DCSServerAddr
,
server
);
MesUtil
.
serverAddress
=
server
;
//
ConfigAppSettings.SaveValue(Setting_Init.DCSServerAddr, server);
Setting_NInit
.
App_DCSServerAddr
=
server
;
LogUtil
.
info
(
$
"保存配置成功: 调试{ isDebug },禁用底部气缸{disBottom},禁用侧挡气缸{disSide},地址{server} "
);
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
SaveOk
,
"保存成功"
));
}
...
...
@@ -205,5 +208,18 @@ ResourceCulture.GetString(ResourceCulture.Sure, "确认"), MessageBoxButtons.Yes
LogUtil
.
info
(
"DCS地址【"
+
serverAddress
+
"】 返回值【"
+
result
+
"】"
);
}
private
void
label2_Click
(
object
sender
,
EventArgs
e
)
{
try
{
ConfigHelper
.
AdvanceConfigForm
.
ShowEditDialog
(
this
);
LogUtil
.
info
(
"用户点击隐藏配置"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
ex
.
ToString
());
}
}
}
}
TSA-V/FrmLanguage.cs
查看文件 @
4397436
...
...
@@ -43,7 +43,7 @@ namespace TSA_V
private
void
btnOk_Click
(
object
sender
,
EventArgs
e
)
{
string
str
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Default_Language
)
;
string
str
=
Setting_NInit
.
App_Default_Language
;
if
(
rbtnEnglish
.
Checked
)
{
//ScanRequestLabel.Switchlanguage(1);
...
...
@@ -59,7 +59,7 @@ namespace TSA_V
str
=
ResourceCulture
.
China
;
}
ResourceCulture
.
SetCurrentCulture
(
str
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Default_Language
,
str
)
;
Setting_NInit
.
App_Default_Language
=
str
;
this
.
Close
();
}
}
...
...
TSA-V/FrmLogin.cs
查看文件 @
4397436
...
...
@@ -16,9 +16,9 @@ namespace TSA_V
public
FrmLogin
()
{
InitializeComponent
();
string
str
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Default_Language
);
LogUtil
.
info
(
"默认语言:"
+
str
);
ResourceCulture
.
SetCurrentCulture
(
str
);
//
string str = ConfigAppSettings.GetValue(Setting_Init.Default_Language);
LogUtil
.
info
(
"默认语言:"
+
Setting_NInit
.
App_Default_Language
);
ResourceCulture
.
SetCurrentCulture
(
Setting_NInit
.
App_Default_Language
);
}
private
void
BtnLogin_Click
(
object
sender
,
EventArgs
e
)
...
...
TSA-V/FrmMenu.cs
查看文件 @
4397436
...
...
@@ -27,9 +27,9 @@ namespace TSA_V
private
bool
isClick
=
false
;
public
FrmMenu
()
{
//设置语言
string
str
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Default_Language
);
LogUtil
.
info
(
"默认语言:"
+
str
);
ResourceCulture
.
SetCurrentCulture
(
str
);
//
string str = ConfigAppSettings.GetValue(Setting_Init.Default_Language);
LogUtil
.
info
(
"默认语言:"
+
Setting_NInit
.
App_Default_Language
);
ResourceCulture
.
SetCurrentCulture
(
Setting_NInit
.
App_Default_Language
);
frmMain
=
this
;
CheckForIllegalCrossThreadCalls
=
false
;
InitializeComponent
();
...
...
@@ -48,6 +48,7 @@ namespace TSA_V
btnCom
.
Visible
=
false
;
}
lblMsg
.
Text
=
""
;
Setting_NInit
.
ChangeConfig
();
//if (FormManager.UserInfo.Limit.Equals(UserLimit.Admin))
//{
// btnMaintenance.Visible = true;
...
...
@@ -147,7 +148,7 @@ namespace TSA_V
});
}
LWidthManager
.
Init
();
this
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_Title
)
;
this
.
Text
=
Setting_NInit
.
App_App_Title
;
btnCloseLed
.
Visible
=
useLed
;
btnOpenLed
.
Visible
=
useLed
;
...
...
@@ -231,8 +232,8 @@ namespace TSA_V
LogUtil
.
error
(
"进入程序界面,还未启动组装信息机,开始启动插件机"
);
TSAVBean
.
StartRun
();
}
int
auto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
if
(
auto
==
1
&&
this
.
Visible
==
true
)
//
int auto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
if
(
Setting_NInit
.
App_AutoRun
&&
this
.
Visible
==
true
)
{
LogUtil
.
info
(
" auto=1,开始自动启动插件机!"
);
btnWork_Click
(
null
,
null
);
...
...
TSA-V/Program.cs
查看文件 @
4397436
using
log4net.Config
;
using
ConfigHelper
;
using
log4net.Config
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
...
...
@@ -102,6 +103,7 @@ namespace TSA_V
Application
.
ThreadException
+=
new
System
.
Threading
.
ThreadExceptionEventHandler
(
Application_ThreadException
);
AppDomain
.
CurrentDomain
.
UnhandledException
+=
new
UnhandledExceptionEventHandler
(
CurrentDomain_UnhandledException
);
Config
.
LoadMyConfig
(
new
Setting_NInit
().
GetType
());
ImageManager
.
Init
();
XmlConfigurator
.
Configure
();
Application
.
EnableVisualStyles
();
...
...
TSA-V/Smart-Workstation.csproj
查看文件 @
4397436
...
...
@@ -74,6 +74,9 @@
<Reference Include="CodeLibrary">
<HintPath>..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper">
<HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="halcondotnet, Version=12.0.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\halcondotnet.dll</HintPath>
...
...
@@ -354,6 +357,7 @@
</EmbeddedResource>
<EmbeddedResource Include="FrmMaintenance.resx">
<DependentUpon>FrmMaintenance.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FrmChangeWidth.resx">
<DependentUpon>FrmChangeWidth.cs</DependentUpon>
...
...
TSA-V/deviceDebug/FrmPusicanTest.cs
查看文件 @
4397436
...
...
@@ -40,7 +40,7 @@ namespace TSA_V
}
if
(!
IOBase
.
NoLine
)
{
uint
chaSlv
=
(
uint
)
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_NodeAddr
)
;
uint
chaSlv
=
(
uint
)
Setting_NInit
.
Line_NodeAddr
.
Val
;
//nodeList.Add(new NodeInfo(chaSlv, "调宽电机_" + chaSlv, "调宽电机_" + chaSlv));
nodeList
.
Add
(
new
NodeInfo
(
chaSlv
,
"Node: "
+
chaSlv
,
"Node: "
+
chaSlv
));
}
...
...
TSA-V/projector/FrmProjectorScreen.cs
查看文件 @
4397436
...
...
@@ -20,7 +20,8 @@ namespace TSA_V
public
FrmProjectorScreen
()
{
InitializeComponent
();
ScreenIndex
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
ProjectorScreen_Index
,
1
);
//ScreenIndex = ConfigAppSettings.GetIntValue(Setting_Init.ProjectorScreen_Index, 1);
ScreenIndex
=
Setting_NInit
.
Device_ProjectorScreen_Index
;
}
public
int
ScreenIndex
=
1
;
public
int
ScreenWidth
=
1920
;
...
...
TSA-V/workForm/FrmAOICheck.cs
查看文件 @
4397436
...
...
@@ -161,7 +161,7 @@ namespace TSA_V
}
chbAllShow
.
Enabled
=
false
;
string
camera
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
)
;
string
camera
=
Setting_NInit
.
Device_CameraName
;
if
(
camera
==
""
)
{
camera
=
AccAOI
.
camera
.
CameraManager
.
hikNameList
.
ToArray
().
FirstOrDefault
();
...
...
TSA-V/workForm/FrmBoardSelect.cs
查看文件 @
4397436
...
...
@@ -52,8 +52,10 @@ namespace TSA_V
cmbBoardList
.
DisplayMember
=
"boardShowName"
;
cmbBoardList
.
ValueMember
=
"boardId"
;
bool
workSingleStart
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
WorkSingleStart
);
bool
offline
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
OfflineMode
);
//bool workSingleStart = ConfigAppSettings.GetBoolValue(Setting_Init.WorkSingleStart);
//bool offline = ConfigAppSettings.GetBoolValue(Setting_Init.OfflineMode);
bool
workSingleStart
=
Setting_NInit
.
Work_WorkSingleStart
;
bool
offline
=
Setting_NInit
.
Work_OfflineMode
;
if
(
offline
)
{
chbOffLine
.
Checked
=
true
;
...
...
@@ -228,8 +230,10 @@ namespace TSA_V
}
LogUtil
.
info
(
"更改配置:启用工作区信号检测开始工作="
+
TSAVBean
.
WorkSingleStart
+
",离线工作模式="
+
TSAVBean
.
OpenOfflineMode
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
WorkSingleStart
,
TSAVBean
.
WorkSingleStart
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
OfflineMode
,
TSAVBean
.
OpenOfflineMode
);
//ConfigAppSettings.SaveValue(Setting_Init.WorkSingleStart, TSAVBean.WorkSingleStart);
//ConfigAppSettings.SaveValue(Setting_Init.OfflineMode, TSAVBean.OpenOfflineMode);
Setting_NInit
.
Work_WorkSingleStart
=
TSAVBean
.
WorkSingleStart
;
Setting_NInit
.
Work_OfflineMode
=
TSAVBean
.
OpenOfflineMode
;
if
(
WorkType
.
Equals
(
1
))
{
...
...
@@ -381,15 +385,18 @@ namespace TSA_V
private
void
CheckIfHaveincomplete
()
{
bool
DisContinueWorking
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
DisContinueWorking
);
//bool DisContinueWorking = ConfigAppSettings.GetBoolValue(Setting_Init.DisContinueWorking);
bool
DisContinueWorking
=
Setting_NInit
.
Work_DisContinueWorking
;
if
(
DisContinueWorking
)
{
return
;
}
string
ProcedureName
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
ProcedureName
);
//string ProcedureName = ConfigAppSettings.GetValue(Setting_Init.ProcedureName);
//string TagNumber = ConfigAppSettings.GetValue(Setting_Init.TagNumber);
string
TagNumber
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
TagNumber
);
if
(!
string
.
IsNullOrEmpty
(
ProcedureName
)&&!
string
.
IsNullOrEmpty
(
TagNumber
))
string
ProcedureName
=
Setting_NInit
.
Work_ProcedureName
;
int
TagNumber
=
Setting_NInit
.
Work_TagNumber
;
if
(!
string
.
IsNullOrEmpty
(
ProcedureName
)&&
TagNumber
>=
0
)
{
BoardInfo
board
=
BoardManager
.
getBoardByName
(
ProcedureName
);
if
(
board
==
null
)
...
...
TSA-V/workForm/FrmTSAV.cs
查看文件 @
4397436
...
...
@@ -70,7 +70,8 @@ namespace TSA_V
timerShowForm
.
Stop
();
//获取记录运行未完成的步骤序号
int
TagNumber
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TagNumber
);
//int TagNumber = ConfigAppSettings.GetIntValue(Setting_Init.TagNumber);
int
TagNumber
=
Setting_NInit
.
Work_TagNumber
;
if
(
workSmtList
.
Count
>
0
&&
TagNumber
!=
0
&&
isContinue
)
{
var
workSmt
=
workSmtList
.
Single
(
a
=>
a
.
pointNum
==
TagNumber
);
...
...
@@ -364,12 +365,12 @@ namespace TSA_V
private
void
btnStartWorking_Click
(
object
sender
,
EventArgs
e
)
{
bool
isCy
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsCycleDebug
);
LogUtil
.
info
(
Name
+
"点击:"
+
btnStartWorking
.
Text
+
",自动启动循环测试模式="
+
isCy
);
//
bool isCy = ConfigAppSettings.GetBoolValue(Setting_Init.IsCycleDebug);
LogUtil
.
info
(
Name
+
"点击:"
+
btnStartWorking
.
Text
+
",自动启动循环测试模式="
+
Setting_NInit
.
Device_IsCycleDebug
);
btnStartWorking
.
Enabled
=
false
;
//开始工作
TSAVBean
.
StartWork
(
BoardManager
.
CurrBoard
);
WorkInfo
.
IsCycleDebug
=
isCy
;
WorkInfo
.
IsCycleDebug
=
Setting_NInit
.
Device_IsCycleDebug
;
btnStartWorking
.
Enabled
=
true
;
}
...
...
@@ -414,7 +415,7 @@ namespace TSA_V
else
{
btnStartWorking
.
Enabled
=
false
;
if
(
TSAVBean
.
IsDebug
.
Equals
(
false
))
if
(
Setting_NInit
.
App_
IsDebug
.
Equals
(
false
))
{
btnNextPoint
.
Enabled
=
false
;
btnPrePoint
.
Enabled
=
false
;
...
...
@@ -612,12 +613,19 @@ namespace TSA_V
lblComNotices
.
Text
=
ResourceCulture
.
GetString
(
"元器件数量不足,请及时补充"
,
"元器件数量不足,请及时补充"
);
}
//记录运行过程的位号
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
board
.
boardName
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
smtPoint
.
pointNum
.
ToString
());
if
(
smtPoint
.
pointNum
==
1
)
//第一个位号不需要记录
//ConfigAppSettings.UpdateAppSetting(Setting_Init.ProcedureName, board.boardName);
//ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, smtPoint.pointNum.ToString());
//if (smtPoint.pointNum==1)//第一个位号不需要记录
//{
// ConfigAppSettings.UpdateAppSetting(Setting_Init.ProcedureName, "");
// ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, "");
//}
Setting_NInit
.
Work_ProcedureName
=
board
.
boardName
;
Setting_NInit
.
Work_TagNumber
=
smtPoint
.
pointNum
;
if
(
smtPoint
.
pointNum
==
1
)
//第一个位号不需要记录
{
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
""
)
;
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
""
)
;
Setting_NInit
.
Work_ProcedureName
=
""
;
Setting_NInit
.
Work_TagNumber
=
0
;
}
#
endregion
}
...
...
@@ -992,7 +1000,8 @@ namespace TSA_V
{
AutoVisiable
(
true
);
TSAVBean
.
WorkMode
=
1
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
WorkMode
,
1
);
//ConfigAppSettings.SaveValue(Setting_Init.WorkMode, 1);
Setting_NInit
.
Work_WorkMode
=
1
;
LogUtil
.
info
(
"切换工作模式为:自动工作"
);
}
else
...
...
@@ -1007,7 +1016,8 @@ namespace TSA_V
{
AutoVisiable
(
false
);
TSAVBean
.
WorkMode
=
0
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
WorkMode
,
0
);
//ConfigAppSettings.SaveValue(Setting_Init.WorkMode, 0);
Setting_NInit
.
Work_WorkMode
=
0
;
LogUtil
.
info
(
"切换工作模式为:脚踏工作"
);
}
else
...
...
@@ -1034,7 +1044,8 @@ namespace TSA_V
}
TSAVBean
.
AuToModeSeconds
=
value
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
AuToModeSeconds
,
value
);
//ConfigAppSettings.SaveValue(Setting_Init.AuToModeSeconds, value);
Setting_NInit
.
Work_AuToModeSeconds
=
value
;
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
UpdateTOK
,
"已更新自动工作时间间隔为{0}秒 "
,
value
)
,
ResourceCulture
.
GetString
(
ResourceCulture
.
MsgTitle
,
"提示"
));
}
...
...
TSA-V/workForm/FrmWorkCount.cs
查看文件 @
4397436
...
...
@@ -71,7 +71,7 @@ namespace TSA_V
}
LogUtil
.
info
(
"切换是否统计:"
+
chbIsWork
.
Checked
);
WorkCountManager
.
IsNeedCount
=
chbIsWork
.
Checked
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
IsNeedCount
,
WorkCountManager
.
IsNeedCount
)
;
Setting_NInit
.
Work_IsNeedCount
=
WorkCountManager
.
IsNeedCount
;
}
}
}
UserFromControl/ProjectorControl.cs
查看文件 @
4397436
...
...
@@ -26,9 +26,9 @@ namespace UserFromControl
{
cmbType
.
SelectedIndex
=
0
;
}
PointSizeX
=
TSAVBean
.
DefaultP
Size
;
PointSizeY
=
TSAVBean
.
DefaultP
Size
;
PointType
=
TSAVBean
.
DefaultP
Type
;
PointSizeX
=
Setting_NInit
.
Device_DefaultPoint
Size
;
PointSizeY
=
Setting_NInit
.
Device_DefaultPoint
Size
;
PointType
=
Setting_NInit
.
Device_DefaultPoint
Type
;
numSizeX
.
Maximum
=
MaxX
/
2
;
numSizeY
.
Maximum
=
MaxY
/
2
;
//LogUtil.info($"投影点位范围:X:{MaxX},Y:{MaxY}");
...
...
UserFromControl/UserFromControl.csproj
查看文件 @
4397436
...
...
@@ -33,6 +33,12 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="CodeLibrary">
<HintPath>..\..\编译完整版\MIMO_HC\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper">
<HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="MetroFramework, Version=1.3.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a, processorArchitecture=MSIL">
<HintPath>..\packages\MetroFramework-1.3.0.0.1.3.0.0\lib\MetroFramework.dll</HintPath>
<Private>True</Private>
...
...
dll/ConfigHelper.dll
查看文件 @
4397436
此文件类型无法预览
dll/ConfigHelper.pdb
查看文件 @
4397436
此文件类型无法预览
dll/ConfigHelper.xml
查看文件 @
4397436
...
...
@@ -57,17 +57,6 @@
the contents of this method with the code editor.
</summary>
</member>
<member
name=
"P:ConfigHelper.CheckedListBoxEx.DataSource"
>
<summary>
绑定数据源
</summary>
<param
name=
"data"
></param>
</member>
<member
name=
"T:ConfigHelper.CheckItem"
>
<summary>
Represents an item in the checklistbox
</summary>
</member>
<member
name=
"T:ConfigHelper.Config"
>
<summary>
自定义配置存取
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论