Commit 43974366 LN

配置修改

1 个父辈 693f71b1
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="ConfigHelper">
<HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="log4net"> <Reference Include="log4net">
<HintPath>..\dll\log4net.dll</HintPath> <HintPath>..\dll\log4net.dll</HintPath>
</Reference> </Reference>
...@@ -73,6 +76,7 @@ ...@@ -73,6 +76,7 @@
<Compile Include="logs\TempLog.cs" /> <Compile Include="logs\TempLog.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting_Init.cs" /> <Compile Include="Setting_Init.cs" />
<Compile Include="Setting_NInit.cs" />
<Compile Include="util\AcSerialBean.cs" /> <Compile Include="util\AcSerialBean.cs" />
<Compile Include="util\ConfigAppSettings.cs" /> <Compile Include="util\ConfigAppSettings.cs" />
<Compile Include="util\FileUtil.cs" /> <Compile Include="util\FileUtil.cs" />
......
...@@ -10,15 +10,16 @@ namespace TSA_V.Common ...@@ -10,15 +10,16 @@ namespace TSA_V.Common
/// 记录配置的key /// 记录配置的key
/// </summary> /// </summary>
public class Setting_Init public class Setting_Init
{ {
/// <summary> //public static string PUSICAN_Position = "PUSICAN_Position";
/// 1时自动启动,并隐藏窗口,=0时不需要
/// </summary>
public static string App_AutoRun = "App_AutoRun";
/// <summary> /// <summary>
/// 系统主界面标题 /// AOI文件路径
/// </summary> /// </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 Board_ConfigPath = "Board_ConfigPath";
public static string Position_Config = "Position_Config"; public static string Position_Config = "Position_Config";
public static string Position_Config_Label = "Position_Config_Label"; public static string Position_Config_Label = "Position_Config_Label";
...@@ -28,32 +29,22 @@ namespace TSA_V.Common ...@@ -28,32 +29,22 @@ namespace TSA_V.Common
/// 保存图片地址 /// 保存图片地址
/// </summary> /// </summary>
public static string BOARD_IMAGE_PATH = "Board_Image_Path"; public static string BOARD_IMAGE_PATH = "Board_Image_Path";
/// <summary> /// <summary>
/// 默认图片 /// 默认图片
/// </summary> /// </summary>
public static string BOARD_IMAGE_DEFAULT = "BOARD_IMAGE_DEFAULT"; 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> /// <summary>
/// IP地址 /// 元器件信息模板
/// </summary> /// </summary>
public static string PUSICAN_Ip = "PUSICAN_Ip"; public static string Componet_Template = "Componet_Template";
public static string AuToSoldering_FilePath = "AuToSoldering_FilePath";
/// <summary> /// <summary>
/// 端口号 /// 料盘旋转轴
/// </summary> /// </summary>
public static string PUSICAN_Port = "PUSICAN_Port"; public static string RNode_Addr = "RNode_Addr";
public static string PUSICAN_Position = "PUSICAN_Position";
public static string RotateNode_MicroStepping = "RotateNode_MicroStepping"; public static string RotateNode_MicroStepping = "RotateNode_MicroStepping";
public static string RotateNode_MaxSpeed = "RotateNode_MaxSpeed"; public static string RotateNode_MaxSpeed = "RotateNode_MaxSpeed";
public static string RotateNode_StartSpeed = "RotateNode_StartSpeed"; public static string RotateNode_StartSpeed = "RotateNode_StartSpeed";
...@@ -65,37 +56,74 @@ namespace TSA_V.Common ...@@ -65,37 +56,74 @@ namespace TSA_V.Common
public static string RotateNode_HomeSpeed = "RotateNode_HomeSpeed"; public static string RotateNode_HomeSpeed = "RotateNode_HomeSpeed";
public static string RotateNode_HomeStartSpeed = "RotateNode_HomeStartSpeed"; public static string RotateNode_HomeStartSpeed = "RotateNode_HomeStartSpeed";
public static string RotateNode_HomeStopSpeed = "RotateNode_HomeStopSpeed"; public static string RotateNode_HomeStopSpeed = "RotateNode_HomeStopSpeed";
/// <summary> /// <summary>
/// 料盘旋转轴 /// 旋转轴(库位轴)默认的位置
/// </summary> /// </summary>
public static string RNode_Addr = "RNode_Addr"; public static string RotateNode_DefaultPosition = "RotateNode_DefaultPosition";
/// <summary> /// <summary>
/// 元器件库的数量,=1表示有一个五层的料库 /// 元器件库的数量,=1表示有一个五层的料库
/// </summary> /// </summary>
public static string TSAV_Storage_Count = "TSAV_Storage_Count"; 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> /// <summary>
/// 旋转轴(库位轴)默认的位置 /// IP地址
/// </summary> /// </summary>
public static string RotateNode_DefaultPosition = "RotateNode_DefaultPosition"; public static string PUSICAN_Ip = "PUSICAN_Ip";
/// <summary> /// <summary>
/// 元器件信息模板 /// 端口号
/// </summary> /// </summary>
public static string Componet_Template = "Componet_Template"; public static string PUSICAN_Port = "PUSICAN_Port";
//以下配置已迁移
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"; 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 AuToSoldering_FilePath = "AuToSoldering_FilePath";
public static string IsDebug = "IsDebug"; public static string IsDebug = "IsDebug";
public static string SolderingLedIP = "SolderingLedIP"; public static string SolderingLedIP = "SolderingLedIP";
public static string SolderingLedIndex = "SolderingLedIndex"; public static string SolderingLedIndex = "SolderingLedIndex";
public static string CameraName = "CameraName"; public static string CameraName = "CameraName";
/// <summary> /// <summary>
/// 是否需要进行AOI检测 /// 是否需要进行AOI检测
/// </summary> /// </summary>
...@@ -111,43 +139,20 @@ namespace TSA_V.Common ...@@ -111,43 +139,20 @@ namespace TSA_V.Common
public static string WorkCount_ConfigPath = "WorkCount_ConfigPath"; public static string WorkCount_ConfigPath = "WorkCount_ConfigPath";
public static string IsNeedCount = "IsNeedCount"; public static string IsNeedCount = "IsNeedCount";
public static string UseAIOBOX = "UseAIOBOX"; public static string UseAIOBOX = "UseAIOBOX";
/// <summary> /// <summary>
/// 元器件库名称的类型,0=英文,1=中文 /// 元器件库名称的类型,0=英文,1=中文
/// </summary> /// </summary>
public static string LibNameType = "LibNameType"; public static string LibNameType = "LibNameType";
/// <summary>
/// AOI文件路径
/// </summary>
public static string AOIFileConfig = "AOIFileConfig";
//public static string Config_Pwd = "Config_Pwd"; //public static string Config_Pwd = "Config_Pwd";
public static string DefaultPointSize = "DefaultPointSize"; public static string DefaultPointSize = "DefaultPointSize";
public static string DefaultPointType = "DefaultPointType"; 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 Server_Log_Open = "Server_Log_Open";
...@@ -184,7 +189,7 @@ namespace TSA_V.Common ...@@ -184,7 +189,7 @@ namespace TSA_V.Common
public static string DisContinueWorking = "DisContinueWorking"; public static string DisContinueWorking = "DisContinueWorking";
public static string DisShowScreenAlarm = "DisShowScreenAlarm"; public static string DisShowScreenAlarm = "DisShowScreenAlarm";
/// <summary> /// <summary>
/// 投影屏幕索引,默认1 /// 投影屏幕索引,默认1
/// </summary> /// </summary>
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<Reference Include="Asa.IOModule.AIOBOX"> <Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\dll\Asa.IOModule.AIOBOX.dll</HintPath> <HintPath>..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference> </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"> <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> <HintPath>..\packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll</HintPath>
</Reference> </Reference>
......
...@@ -332,7 +332,7 @@ namespace TSA_V.DeviceLibrary ...@@ -332,7 +332,7 @@ namespace TSA_V.DeviceLibrary
public string GetDisplayStr() public string GetDisplayStr()
{ {
string text = PN; string text = PN;
if (BoardManager.PointDisplayType.Equals(1)) if (Setting_NInit.Work_PointDisplayType.Equals(1))
{ {
text = TagNo; text = TagNo;
} }
......
...@@ -14,7 +14,7 @@ namespace TSA_V.LoadCSVLibrary ...@@ -14,7 +14,7 @@ namespace TSA_V.LoadCSVLibrary
{ {
public static char Spilt_Char = ','; public static char Spilt_Char = ',';
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 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) public static Dictionary<string, string> getProAttributeMap(Type type)
{ {
......
...@@ -24,7 +24,8 @@ namespace TSA_V.DeviceLibrary ...@@ -24,7 +24,8 @@ namespace TSA_V.DeviceLibrary
public static void Init() 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) if (isAIOBox==1)
{ {
instance = new AIOBOXManager(); instance = new AIOBOXManager();
......
...@@ -35,8 +35,8 @@ namespace TSA_V.DeviceLibrary ...@@ -35,8 +35,8 @@ namespace TSA_V.DeviceLibrary
public static void InitData() public static void InitData()
{ {
KNDIP = ConfigAppSettings.GetValue(Setting_Init.IO_IP); KNDIP = Setting_NInit.Device_IO_IP;
KNDPort = (ushort)ConfigAppSettings.GetIntValue(Setting_Init.IO_Port); KNDPort = (ushort)Setting_NInit.Device_IO_Port;
byte slaveId = (byte)0; byte slaveId = (byte)0;
IOBase.Init(); IOBase.Init();
builder = new StringBuilder("\r\n"); builder = new StringBuilder("\r\n");
......
...@@ -16,7 +16,7 @@ namespace TSA_V.DeviceLibrary ...@@ -16,7 +16,7 @@ namespace TSA_V.DeviceLibrary
{ {
public class BoardManager 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; private static int MaxId = 0;
/// <summary> /// <summary>
/// 板子列表 /// 板子列表
......
...@@ -15,11 +15,11 @@ namespace TSA_V.DeviceLibrary ...@@ -15,11 +15,11 @@ namespace TSA_V.DeviceLibrary
/// </summary> /// </summary>
public class LWidthManager public class LWidthManager
{ {
public static int Line_ChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.Line_ChangeValue); public static int Line_ChangeValue = Setting_NInit.Line_ChangeValue;
public static int Line_HomeWidth = ConfigAppSettings.GetIntValue(Setting_Init.Line_HomeWidth); public static int Line_HomeWidth = Setting_NInit.Line_HomeWidth;
public static uint Line_NodeAddr =(uint) ConfigAppSettings.GetIntValue(Setting_Init.Line_NodeAddr); public static uint Line_NodeAddr =(uint)(Setting_NInit.Line_NodeAddr.Val);
public static int Line_LastWidth = ConfigAppSettings.GetIntValue(Setting_Init.Line_LastWidth); public static int Line_LastWidth = Setting_NInit.Line_LastWidth;
private static string Line_WidthPosition = ConfigAppSettings.GetValue(Setting_Init.Line_WidthPosition); private static string Line_WidthPosition = Setting_NInit.Line_WidthPosition;
public static int DefaultPosition = 0; public static int DefaultPosition = 0;
public static bool LineInitOk = false; public static bool LineInitOk = false;
...@@ -104,7 +104,7 @@ namespace TSA_V.DeviceLibrary ...@@ -104,7 +104,7 @@ namespace TSA_V.DeviceLibrary
Line_LastWidth = targetWidth; Line_LastWidth = targetWidth;
DefaultPosition = targetPosition; DefaultPosition = targetPosition;
ConfigAppSettings.SaveValue(Setting_Init.Line_LastWidth, Line_LastWidth); Setting_NInit.Line_LastWidth=Line_LastWidth;
// PUSICANLibrary.PUSICANControl.AbsMove(Line_NodeAddr, targetPosition); // PUSICANLibrary.PUSICANControl.AbsMove(Line_NodeAddr, targetPosition);
Stopwatch stopwatch = new Stopwatch(); Stopwatch stopwatch = new Stopwatch();
...@@ -265,7 +265,7 @@ namespace TSA_V.DeviceLibrary ...@@ -265,7 +265,7 @@ namespace TSA_V.DeviceLibrary
} }
newStr = newStr.Substring(0, newStr.Length - 1); newStr = newStr.Substring(0, newStr.Length - 1);
Line_WidthPosition = newStr; Line_WidthPosition = newStr;
ConfigAppSettings.SaveValue(Setting_Init.Line_WidthPosition, Line_WidthPosition); Setting_NInit.Line_WidthPosition= Line_WidthPosition;
} }
} }
} }
...@@ -21,7 +21,8 @@ namespace TSA_V ...@@ -21,7 +21,8 @@ namespace TSA_V
public static bool AOIopen = false; 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; private static System.Timers.Timer proTimer = null;
......
...@@ -14,14 +14,14 @@ namespace TSA_V.DeviceLibrary ...@@ -14,14 +14,14 @@ namespace TSA_V.DeviceLibrary
{ {
public partial class TSAVBean public partial class TSAVBean
{ {
public static bool IsDebug = ConfigAppSettings.GetBoolValue(Setting_Init.IsDebug); //public static bool IsDebug = ConfigAppSettings.GetBoolValue(Setting_Init.IsDebug);
public static bool SideCylinderMoveFirst = ConfigAppSettings.GetBoolValue(Setting_Init.SideCylinderMoveFirst); //public static bool SideCylinderMoveFirst = ConfigAppSettings.GetBoolValue(Setting_Init.SideCylinderMoveFirst);
public static string Name = "MASCOT"; public static string Name = "MASCOT";
public static int RotateNode_DefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_DefaultPosition); 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 Dictionary<int, Dictionary<int, NodeInfo>> RotateMap = new Dictionary<int, Dictionary<int, NodeInfo>>();
public static int DefaultPType = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointType); //public static int DefaultPType = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointType);
public static int DefaultPSize = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointSize); //public static int DefaultPSize = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointSize);
public static bool DisableSideCylinder = false; public static bool DisableSideCylinder = false;
public static bool DisableBottomCylinder = false; public static bool DisableBottomCylinder = false;
...@@ -46,7 +46,7 @@ namespace TSA_V.DeviceLibrary ...@@ -46,7 +46,7 @@ namespace TSA_V.DeviceLibrary
/// <summary> /// <summary>
/// 工作模式,0=脚踏模式,1=自动模式 /// 工作模式,0=脚踏模式,1=自动模式
/// </summary> /// </summary>
public static int WorkMode = ConfigAppSettings.GetIntValue(Setting_Init.WorkMode); public static int WorkMode =Setting_NInit.Work_WorkMode;
/// <summary> /// <summary>
/// 自动模式下,踩脚踏或按按钮, 自动模式暂停,界面显示暂停状态;再次踩脚踏或按按钮,退出暂停状态 /// 自动模式下,踩脚踏或按按钮, 自动模式暂停,界面显示暂停状态;再次踩脚踏或按按钮,退出暂停状态
...@@ -57,7 +57,7 @@ namespace TSA_V.DeviceLibrary ...@@ -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 TSAVStatus Status = TSAVStatus.Wait;
public static ResetStep resetStep = ResetStep.OpenCan_0; public static ResetStep resetStep = ResetStep.OpenCan_0;
...@@ -65,7 +65,7 @@ namespace TSA_V.DeviceLibrary ...@@ -65,7 +65,7 @@ namespace TSA_V.DeviceLibrary
private static System.Timers.Timer workTimer = null; private static System.Timers.Timer workTimer = null;
public static WorkInfo Work = new WorkInfo(); 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 bool IsCanStepMove = false;
public static int LastStepIndex = 4; public static int LastStepIndex = 4;
...@@ -84,8 +84,8 @@ namespace TSA_V.DeviceLibrary ...@@ -84,8 +84,8 @@ namespace TSA_V.DeviceLibrary
public static string LoadTSAV() public static string LoadTSAV()
{ {
LogUtil.info(Name + "开始加载电机配置。。"); LogUtil.info(Name + "开始加载电机配置。。");
DisableSideCylinder = ConfigAppSettings.GetBoolValue(Setting_Init.DisableSideCylinder); DisableSideCylinder = Setting_NInit.Device_DisableSideCylinder;
DisableBottomCylinder = ConfigAppSettings.GetBoolValue(Setting_Init.DisableBottomCylinder); DisableBottomCylinder = Setting_NInit.Device_DisableBottomCylinder;
if (workTimer == null) if (workTimer == null)
{ {
workTimer = new System.Timers.Timer(); workTimer = new System.Timers.Timer();
...@@ -114,13 +114,13 @@ namespace TSA_V.DeviceLibrary ...@@ -114,13 +114,13 @@ namespace TSA_V.DeviceLibrary
} }
} }
if (DefaultPType <= 0 || DefaultPType > 5) if (Setting_NInit.Device_DefaultPointType <= 0 || Setting_NInit.Device_DefaultPointType > 5)
{ {
DefaultPType = 1; Setting_NInit.Device_DefaultPointType = 1;
} }
if (DefaultPSize <= 0 || DefaultPSize > 100) if (Setting_NInit.Device_DefaultPointSize <= 0 || Setting_NInit.Device_DefaultPointSize > 100)
{ {
DefaultPSize = 4; Setting_NInit.Device_DefaultPointSize = 4;
} }
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
...@@ -777,7 +777,7 @@ namespace TSA_V.DeviceLibrary ...@@ -777,7 +777,7 @@ namespace TSA_V.DeviceLibrary
else else
{ {
//自动模式 //自动模式
if ((span.TotalSeconds > AuToModeSeconds && IsDebug) if ((span.TotalSeconds > AuToModeSeconds && Setting_NInit.App_IsDebug)
|| (span.TotalSeconds > AuToModeSeconds && WorkMode.Equals(1)) || (span.TotalSeconds > AuToModeSeconds && WorkMode.Equals(1))
) )
{ {
...@@ -789,7 +789,7 @@ namespace TSA_V.DeviceLibrary ...@@ -789,7 +789,7 @@ namespace TSA_V.DeviceLibrary
{ {
//脚踏模式 //脚踏模式
if (IsFootOk if (IsFootOk
|| (span.TotalSeconds > AuToModeSeconds && IsDebug)) || (span.TotalSeconds > AuToModeSeconds && Setting_NInit.App_IsDebug))
{ {
Work.MoveToNextPoint(true); Work.MoveToNextPoint(true);
} }
...@@ -807,7 +807,7 @@ namespace TSA_V.DeviceLibrary ...@@ -807,7 +807,7 @@ namespace TSA_V.DeviceLibrary
{ {
if (Work.WorkType.Equals(2)) 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)))) || (span.TotalSeconds > Work.currPoint.WeldTime + 6 && WorkMode.Equals(1))))
{ {
Work.MoveToNextPoint(true); Work.MoveToNextPoint(true);
...@@ -815,7 +815,7 @@ namespace TSA_V.DeviceLibrary ...@@ -815,7 +815,7 @@ namespace TSA_V.DeviceLibrary
} }
else if (Work.WorkType.Equals(3)) 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)))) || (span.TotalSeconds > 8 && WorkMode.Equals(1))))
{ {
Work.MoveToNextPoint(true); Work.MoveToNextPoint(true);
......
...@@ -274,7 +274,7 @@ namespace TSA_V.DeviceLibrary ...@@ -274,7 +274,7 @@ namespace TSA_V.DeviceLibrary
} }
else if (LineStep.IsStep(StepEnum.LS04_StopLine)) else if (LineStep.IsStep(StepEnum.LS04_StopLine))
{ {
if (SideCylinderMoveFirst) if (Setting_NInit.Device_SideCylinderMoveFirst)
{ {
LineStep.NextStep(StepEnum.LS05_SideCylindeMove); LineStep.NextStep(StepEnum.LS05_SideCylindeMove);
LineLog("流水线转动:侧挡气缸先前进"); LineLog("流水线转动:侧挡气缸先前进");
...@@ -301,8 +301,8 @@ namespace TSA_V.DeviceLibrary ...@@ -301,8 +301,8 @@ namespace TSA_V.DeviceLibrary
} }
else if (LineStep.IsStep(StepEnum.LS07_SideCylindeMove)) else if (LineStep.IsStep(StepEnum.LS07_SideCylindeMove))
{ {
bool needCode = ConfigAppSettings.GetBoolValue(Setting_Init.NeedPCBCode); //bool needCode = ConfigAppSettings.GetBoolValue(Setting_Init.NeedPCBCode);
if (needCode) if (Setting_NInit.Device_NeedPCBCode)
{ {
LineStep.NextStep(StepEnum.LS08_WaitCode); LineStep.NextStep(StepEnum.LS08_WaitCode);
LineLog("流水线转动:停止流水线,等待输入二维码"); LineLog("流水线转动:停止流水线,等待输入二维码");
......
...@@ -52,7 +52,7 @@ namespace TSA_V.DeviceLibrary ...@@ -52,7 +52,7 @@ namespace TSA_V.DeviceLibrary
if (isContinue) if (isContinue)
{ {
LogUtil.info("开始程序【" + boardInfo.boardName + "】的插件 , 继续之前的工作,索引号="+currIndex); LogUtil.info("开始程序【" + boardInfo.boardName + "】的插件 , 继续之前的工作,索引号="+currIndex);
currIndex = ConfigAppSettings.GetIntValue(Setting_Init.TagNumber); currIndex = Convert.ToInt32(Setting_NInit.Work_TagNumber);
isContinue = false; isContinue = false;
} }
else else
...@@ -221,13 +221,21 @@ namespace TSA_V.DeviceLibrary ...@@ -221,13 +221,21 @@ namespace TSA_V.DeviceLibrary
{ {
#region 2023-10-31添加 #region 2023-10-31添加
position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum); position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum);
//记录运行过程的位号 ////记录运行过程的位号
ConfigAppSettings.UpdateAppSetting(Setting_Init.ProcedureName, currBoard.boardName); //ConfigAppSettings.UpdateAppSetting(Setting_Init.ProcedureName, currBoard.boardName);
ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, currIndex.ToString()); //ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, currIndex.ToString());
if (currPoint.pointNum == 1)//第一个位号不需要记录
//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, ""); Setting_NInit.Work_ProcedureName=currBoard.boardName;
ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, ""); Setting_NInit.Work_TagNumber = currIndex;
} }
#endregion #endregion
useComponets.Add(com); useComponets.Add(com);
......
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Security.Policy;
using System.ServiceModel; using System.ServiceModel;
using System.ServiceModel.Activation; using System.ServiceModel.Activation;
using System.ServiceModel.Web; using System.ServiceModel.Web;
...@@ -51,9 +52,10 @@ namespace TSA_V.DeviceLibrary ...@@ -51,9 +52,10 @@ namespace TSA_V.DeviceLibrary
/// <param name="url"></param> /// <param name="url"></param>
/// <returns></returns> /// <returns></returns>
public static bool Open() public static bool Open()
{ {
//获取状态:http://localhost:4090/rest/api/v1/station/status //获取状态: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)) if (String.IsNullOrEmpty(serverAddress))
{ {
return false ; return false ;
...@@ -87,7 +89,7 @@ namespace TSA_V.DeviceLibrary ...@@ -87,7 +89,7 @@ namespace TSA_V.DeviceLibrary
#region 上传工作结果 #region 上传工作结果
public static string serverAddress = ConfigAppSettings.GetValue(Setting_Init.DCSServerAddr); public static string serverAddress = Setting_NInit.App_DCSServerAddr;
public static string SendStatus(DeviceStatus status) public static string SendStatus(DeviceStatus status)
{ {
if (String.IsNullOrEmpty(serverAddress)) if (String.IsNullOrEmpty(serverAddress))
......
...@@ -51,7 +51,7 @@ namespace TSA_V.Common ...@@ -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) public static string PostJson(string url, Object operation, bool simulate = false)
{ {
......
...@@ -36,6 +36,9 @@ public class ServerCommunication : IDisposable ...@@ -36,6 +36,9 @@ public class ServerCommunication : IDisposable
CID = ConfigAppSettings.GetValue("SMF_CID", DefaultCid); CID = ConfigAppSettings.GetValue("SMF_CID", DefaultCid);
server = Setting_NInit.App_Server;
CID = Setting_NInit.App_Cid;
if(String.IsNullOrEmpty(CID)) if(String.IsNullOrEmpty(CID))
{ {
CID = DefaultCid; CID = DefaultCid;
......
...@@ -64,11 +64,11 @@ namespace TSA_V ...@@ -64,11 +64,11 @@ namespace TSA_V
if (smtPoint.PointSizeX < 1 || smtPoint.PointSizeX > 255) if (smtPoint.PointSizeX < 1 || smtPoint.PointSizeX > 255)
{ {
smtPoint.PointSizeX = TSAVBean.DefaultPSize; smtPoint.PointSizeX = Setting_NInit.Device_DefaultPointSize;
} }
if (smtPoint.PointSizeY < 1 || smtPoint.PointSizeY > 255) if (smtPoint.PointSizeY < 1 || smtPoint.PointSizeY > 255)
{ {
smtPoint.PointSizeY = TSAVBean.DefaultPSize; smtPoint.PointSizeY = Setting_NInit.Device_DefaultPointSize;
} }
//smtPoint.PointSize = 4; //smtPoint.PointSize = 4;
//smtPoint.NodePositionX = BPoint.NodePositionX - (BPoint.NodePositionX - APoint.NodePositionX) * (BPoint.PositionX - smtPoint.PositionX) / (BPoint.PositionX - APoint.PositionX); //smtPoint.NodePositionX = BPoint.NodePositionX - (BPoint.NodePositionX - APoint.NodePositionX) * (BPoint.PositionX - smtPoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
......
...@@ -32,9 +32,9 @@ namespace TSA_V ...@@ -32,9 +32,9 @@ namespace TSA_V
private List<int> widthList = new List<int>(); private List<int> widthList = new List<int>();
private void LoadData() private void LoadData()
{ {
numChangeValue.Value = ConfigAppSettings.GetIntValue(Setting_Init.Line_ChangeValue); numChangeValue.Value = Setting_NInit.Line_ChangeValue;
numHomeWidth.Value = ConfigAppSettings.GetIntValue(Setting_Init.Line_HomeWidth); numHomeWidth.Value = Setting_NInit.Line_HomeWidth;
numSlv.Value = ConfigAppSettings.GetIntValue(Setting_Init.Line_NodeAddr); numSlv.Value = Setting_NInit.Line_NodeAddr;
numTarget.Value = defaultWidth; numTarget.Value = defaultWidth;
txtTargetPosition.Text = (defaultWidth - ((int)numHomeWidth.Value)) * ((int)numChangeValue.Value) + ""; txtTargetPosition.Text = (defaultWidth - ((int)numHomeWidth.Value)) * ((int)numChangeValue.Value) + "";
LoadList(); LoadList();
...@@ -99,9 +99,9 @@ namespace TSA_V ...@@ -99,9 +99,9 @@ namespace TSA_V
int homeWidth = (int)numHomeWidth.Value; int homeWidth = (int)numHomeWidth.Value;
int numChange = (int)numChangeValue.Value; int numChange = (int)numChangeValue.Value;
ConfigAppSettings.SaveValue(Setting_Init.Line_NodeAddr, slvAddr); Setting_NInit.Line_NodeAddr= slvAddr;
ConfigAppSettings.SaveValue(Setting_Init.Line_ChangeValue, numChange); Setting_NInit.Line_ChangeValue= numChange;
ConfigAppSettings.SaveValue(Setting_Init.Line_HomeWidth, homeWidth); Setting_NInit.Line_HomeWidth = homeWidth;
LWidthManager.Line_NodeAddr = (uint)slvAddr; LWidthManager.Line_NodeAddr = (uint)slvAddr;
LWidthManager.Line_HomeWidth = homeWidth; LWidthManager.Line_HomeWidth = homeWidth;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblconfigdetial = new System.Windows.Forms.Label();
this.chbDisSideCylinder = new System.Windows.Forms.CheckBox(); this.chbDisSideCylinder = new System.Windows.Forms.CheckBox();
this.chbDisBottomCylinder = new System.Windows.Forms.CheckBox(); this.chbDisBottomCylinder = new System.Windows.Forms.CheckBox();
this.chbISDebug = new System.Windows.Forms.CheckBox(); this.chbISDebug = new System.Windows.Forms.CheckBox();
...@@ -70,6 +71,7 @@ ...@@ -70,6 +71,7 @@
// //
// groupBox1 // groupBox1
// //
this.groupBox1.Controls.Add(this.lblconfigdetial);
this.groupBox1.Controls.Add(this.chbDisSideCylinder); this.groupBox1.Controls.Add(this.chbDisSideCylinder);
this.groupBox1.Controls.Add(this.chbDisBottomCylinder); this.groupBox1.Controls.Add(this.chbDisBottomCylinder);
this.groupBox1.Controls.Add(this.chbISDebug); this.groupBox1.Controls.Add(this.chbISDebug);
...@@ -81,6 +83,17 @@ ...@@ -81,6 +83,17 @@
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "其他参数"; 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 // chbDisSideCylinder
// //
this.chbDisSideCylinder.AutoSize = true; this.chbDisSideCylinder.AutoSize = true;
...@@ -513,5 +526,6 @@ ...@@ -513,5 +526,6 @@
private System.Windows.Forms.Button btnTest; private System.Windows.Forms.Button btnTest;
private System.Windows.Forms.CheckBox chbDisSideCylinder; private System.Windows.Forms.CheckBox chbDisSideCylinder;
private System.Windows.Forms.CheckBox chbDisBottomCylinder; private System.Windows.Forms.CheckBox chbDisBottomCylinder;
private System.Windows.Forms.Label lblconfigdetial;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -42,7 +42,7 @@ namespace TSA_V ...@@ -42,7 +42,7 @@ namespace TSA_V
private void FrmLanguage_Load(object sender, EventArgs e) private void FrmLanguage_Load(object sender, EventArgs e)
{ {
LanguageProcess(); LanguageProcess();
this.chbISDebug.Checked = TSAVBean.IsDebug; this.chbISDebug.Checked = Setting_NInit.App_IsDebug;
this.chbDisBottomCylinder.Checked = TSAVBean.DisableBottomCylinder; this.chbDisBottomCylinder.Checked = TSAVBean.DisableBottomCylinder;
this.chbDisSideCylinder.Checked = TSAVBean.DisableSideCylinder; this.chbDisSideCylinder.Checked = TSAVBean.DisableSideCylinder;
this.txtKNDIP.Text = IOManager.KNDIP.ToString(); this.txtKNDIP.Text = IOManager.KNDIP.ToString();
...@@ -50,15 +50,15 @@ namespace TSA_V ...@@ -50,15 +50,15 @@ namespace TSA_V
LoadCom(); LoadCom();
SetScreen(); SetScreen();
cmbType.SelectedIndex = 0; cmbType.SelectedIndex = 0;
int value= TSAVBean.DefaultPType - 1; int value= Setting_NInit.Device_DefaultPointType - 1;
if (cmbBoardList.Items.Count > value && value >= 0) if (cmbBoardList.Items.Count > value && value >= 0)
{ {
cmbBoardList.SelectedIndex = value; cmbBoardList.SelectedIndex = value;
} }
numSizeX.Text = TSAVBean.DefaultPSize.ToString(); numSizeX.Text = Setting_NInit.Device_DefaultPointSize.ToString();
numSizeY.Text = TSAVBean.DefaultPSize.ToString(); numSizeY.Text = Setting_NInit.Device_DefaultPointSize.ToString();
txtAddr.Text = ConfigAppSettings.GetValue(Setting_Init.DCSServerAddr); txtAddr.Text =Setting_NInit.App_DCSServerAddr ;
if(MesUtil.CodeISOk&& MesUtil.CurrPCBCode != "") if(MesUtil.CodeISOk&& MesUtil.CurrPCBCode != "")
{ {
txtCode.Text = MesUtil.CurrPCBCode; txtCode.Text = MesUtil.CurrPCBCode;
...@@ -110,21 +110,24 @@ namespace TSA_V ...@@ -110,21 +110,24 @@ namespace TSA_V
private void SaveData() private void SaveData()
{ {
bool isDebug = chbISDebug.Checked; bool isDebug = chbISDebug.Checked;
ConfigAppSettings.SaveValue(Setting_Init.IsDebug, isDebug); //ConfigAppSettings.SaveValue(Setting_Init.IsDebug, isDebug);
TSAVBean.IsDebug = isDebug;
Setting_NInit.App_IsDebug = isDebug;
bool disBottom = chbDisBottomCylinder.Checked; bool disBottom = chbDisBottomCylinder.Checked;
ConfigAppSettings.SaveValue(Setting_Init.DisableBottomCylinder,disBottom); //ConfigAppSettings.SaveValue(Setting_Init.DisableBottomCylinder,disBottom);
Setting_NInit.Device_DisableBottomCylinder= disBottom;
TSAVBean.DisableBottomCylinder = disBottom; TSAVBean.DisableBottomCylinder = disBottom;
bool disSide = chbDisSideCylinder.Checked; bool disSide = chbDisSideCylinder.Checked;
ConfigAppSettings.SaveValue(Setting_Init.DisableSideCylinder, disSide); //ConfigAppSettings.SaveValue(Setting_Init.DisableSideCylinder, disSide);
Setting_NInit.Device_DisableSideCylinder=disSide;
TSAVBean.DisableSideCylinder = disSide; TSAVBean.DisableSideCylinder = disSide;
string server = txtAddr.Text.Trim(); string server = txtAddr.Text.Trim();
ConfigAppSettings.SaveValue(Setting_Init.DCSServerAddr, server); //ConfigAppSettings.SaveValue(Setting_Init.DCSServerAddr, server);
MesUtil.serverAddress = server; Setting_NInit.App_DCSServerAddr = server;
LogUtil.info($"保存配置成功: 调试{ isDebug },禁用底部气缸{disBottom},禁用侧挡气缸{disSide},地址{server} "); LogUtil.info($"保存配置成功: 调试{ isDebug },禁用底部气缸{disBottom},禁用侧挡气缸{disSide},地址{server} ");
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SaveOk, "保存成功")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SaveOk, "保存成功"));
} }
...@@ -205,5 +208,18 @@ ResourceCulture.GetString(ResourceCulture.Sure, "确认"), MessageBoxButtons.Yes ...@@ -205,5 +208,18 @@ ResourceCulture.GetString(ResourceCulture.Sure, "确认"), MessageBoxButtons.Yes
LogUtil.info("DCS地址【" + serverAddress + "】 返回值【" + result + "】"); 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());
}
}
} }
} }
...@@ -43,7 +43,7 @@ namespace TSA_V ...@@ -43,7 +43,7 @@ namespace TSA_V
private void btnOk_Click(object sender, EventArgs e) 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) if (rbtnEnglish.Checked)
{ {
//ScanRequestLabel.Switchlanguage(1); //ScanRequestLabel.Switchlanguage(1);
...@@ -59,7 +59,7 @@ namespace TSA_V ...@@ -59,7 +59,7 @@ namespace TSA_V
str = ResourceCulture.China; str = ResourceCulture.China;
} }
ResourceCulture.SetCurrentCulture(str); ResourceCulture.SetCurrentCulture(str);
ConfigAppSettings.SaveValue(Setting_Init.Default_Language, str); Setting_NInit.App_Default_Language = str;
this.Close(); this.Close();
} }
} }
......
...@@ -16,9 +16,9 @@ namespace TSA_V ...@@ -16,9 +16,9 @@ namespace TSA_V
public FrmLogin() public FrmLogin()
{ {
InitializeComponent(); InitializeComponent();
string str = ConfigAppSettings.GetValue(Setting_Init.Default_Language); //string str = ConfigAppSettings.GetValue(Setting_Init.Default_Language);
LogUtil.info("默认语言:" + str); LogUtil.info("默认语言:" + Setting_NInit.App_Default_Language);
ResourceCulture.SetCurrentCulture(str); ResourceCulture.SetCurrentCulture(Setting_NInit.App_Default_Language);
} }
private void BtnLogin_Click(object sender, EventArgs e) private void BtnLogin_Click(object sender, EventArgs e)
......
...@@ -27,9 +27,9 @@ namespace TSA_V ...@@ -27,9 +27,9 @@ namespace TSA_V
private bool isClick = false; private bool isClick = false;
public FrmMenu() public FrmMenu()
{ //设置语言 { //设置语言
string str = ConfigAppSettings.GetValue(Setting_Init.Default_Language); //string str = ConfigAppSettings.GetValue(Setting_Init.Default_Language);
LogUtil.info("默认语言:" + str); LogUtil.info("默认语言:" + Setting_NInit.App_Default_Language);
ResourceCulture.SetCurrentCulture(str); ResourceCulture.SetCurrentCulture(Setting_NInit.App_Default_Language);
frmMain = this; frmMain = this;
CheckForIllegalCrossThreadCalls = false; CheckForIllegalCrossThreadCalls = false;
InitializeComponent(); InitializeComponent();
...@@ -48,6 +48,7 @@ namespace TSA_V ...@@ -48,6 +48,7 @@ namespace TSA_V
btnCom.Visible = false; btnCom.Visible = false;
} }
lblMsg.Text = ""; lblMsg.Text = "";
Setting_NInit.ChangeConfig();
//if (FormManager.UserInfo.Limit.Equals(UserLimit.Admin)) //if (FormManager.UserInfo.Limit.Equals(UserLimit.Admin))
//{ //{
// btnMaintenance.Visible = true; // btnMaintenance.Visible = true;
...@@ -147,7 +148,7 @@ namespace TSA_V ...@@ -147,7 +148,7 @@ namespace TSA_V
}); });
} }
LWidthManager.Init(); LWidthManager.Init();
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title); this.Text = Setting_NInit.App_App_Title;
btnCloseLed.Visible = useLed; btnCloseLed.Visible = useLed;
btnOpenLed.Visible = useLed; btnOpenLed.Visible = useLed;
...@@ -231,8 +232,8 @@ namespace TSA_V ...@@ -231,8 +232,8 @@ namespace TSA_V
LogUtil.error("进入程序界面,还未启动组装信息机,开始启动插件机"); LogUtil.error("进入程序界面,还未启动组装信息机,开始启动插件机");
TSAVBean.StartRun(); TSAVBean.StartRun();
} }
int auto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun); //int auto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
if (auto == 1 && this.Visible == true) if (Setting_NInit.App_AutoRun && this.Visible == true)
{ {
LogUtil.info(" auto=1,开始自动启动插件机!"); LogUtil.info(" auto=1,开始自动启动插件机!");
btnWork_Click(null, null); btnWork_Click(null, null);
......
using log4net.Config; using ConfigHelper;
using log4net.Config;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
...@@ -102,6 +103,7 @@ namespace TSA_V ...@@ -102,6 +103,7 @@ namespace TSA_V
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Config.LoadMyConfig(new Setting_NInit().GetType());
ImageManager.Init(); ImageManager.Init();
XmlConfigurator.Configure(); XmlConfigurator.Configure();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
......
...@@ -74,6 +74,9 @@ ...@@ -74,6 +74,9 @@
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary">
<HintPath>..\dll\CodeLibrary.dll</HintPath> <HintPath>..\dll\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigHelper">
<HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="halcondotnet, Version=12.0.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8, processorArchitecture=MSIL"> <Reference Include="halcondotnet, Version=12.0.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\halcondotnet.dll</HintPath> <HintPath>..\dll\halcondotnet.dll</HintPath>
...@@ -354,6 +357,7 @@ ...@@ -354,6 +357,7 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmMaintenance.resx"> <EmbeddedResource Include="FrmMaintenance.resx">
<DependentUpon>FrmMaintenance.cs</DependentUpon> <DependentUpon>FrmMaintenance.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmChangeWidth.resx"> <EmbeddedResource Include="FrmChangeWidth.resx">
<DependentUpon>FrmChangeWidth.cs</DependentUpon> <DependentUpon>FrmChangeWidth.cs</DependentUpon>
......
...@@ -40,7 +40,7 @@ namespace TSA_V ...@@ -40,7 +40,7 @@ namespace TSA_V
} }
if (!IOBase.NoLine) 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, "调宽电机_" + chaSlv, "调宽电机_" + chaSlv));
nodeList.Add(new NodeInfo(chaSlv, "Node: " + chaSlv, "Node: " + chaSlv)); nodeList.Add(new NodeInfo(chaSlv, "Node: " + chaSlv, "Node: " + chaSlv));
} }
......
...@@ -20,7 +20,8 @@ namespace TSA_V ...@@ -20,7 +20,8 @@ namespace TSA_V
public FrmProjectorScreen() public FrmProjectorScreen()
{ {
InitializeComponent(); 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 ScreenIndex = 1;
public int ScreenWidth = 1920; public int ScreenWidth = 1920;
......
...@@ -161,7 +161,7 @@ namespace TSA_V ...@@ -161,7 +161,7 @@ namespace TSA_V
} }
chbAllShow.Enabled = false; chbAllShow.Enabled = false;
string camera = ConfigAppSettings.GetValue(Setting_Init.CameraName); string camera = Setting_NInit.Device_CameraName;
if (camera == "") if (camera == "")
{ {
camera = AccAOI.camera.CameraManager.hikNameList.ToArray().FirstOrDefault(); camera = AccAOI.camera.CameraManager.hikNameList.ToArray().FirstOrDefault();
......
...@@ -52,8 +52,10 @@ namespace TSA_V ...@@ -52,8 +52,10 @@ namespace TSA_V
cmbBoardList.DisplayMember = "boardShowName"; cmbBoardList.DisplayMember = "boardShowName";
cmbBoardList.ValueMember = "boardId"; cmbBoardList.ValueMember = "boardId";
bool workSingleStart = ConfigAppSettings.GetBoolValue(Setting_Init.WorkSingleStart); //bool workSingleStart = ConfigAppSettings.GetBoolValue(Setting_Init.WorkSingleStart);
bool offline = ConfigAppSettings.GetBoolValue(Setting_Init.OfflineMode); //bool offline = ConfigAppSettings.GetBoolValue(Setting_Init.OfflineMode);
bool workSingleStart = Setting_NInit.Work_WorkSingleStart;
bool offline =Setting_NInit.Work_OfflineMode;
if (offline) if (offline)
{ {
chbOffLine.Checked = true; chbOffLine.Checked = true;
...@@ -228,8 +230,10 @@ namespace TSA_V ...@@ -228,8 +230,10 @@ namespace TSA_V
} }
LogUtil.info("更改配置:启用工作区信号检测开始工作=" + TSAVBean.WorkSingleStart + ",离线工作模式=" + TSAVBean.OpenOfflineMode); LogUtil.info("更改配置:启用工作区信号检测开始工作=" + TSAVBean.WorkSingleStart + ",离线工作模式=" + TSAVBean.OpenOfflineMode);
ConfigAppSettings.SaveValue(Setting_Init.WorkSingleStart, TSAVBean.WorkSingleStart); //ConfigAppSettings.SaveValue(Setting_Init.WorkSingleStart, TSAVBean.WorkSingleStart);
ConfigAppSettings.SaveValue(Setting_Init.OfflineMode, TSAVBean.OpenOfflineMode); //ConfigAppSettings.SaveValue(Setting_Init.OfflineMode, TSAVBean.OpenOfflineMode);
Setting_NInit.Work_WorkSingleStart = TSAVBean.WorkSingleStart;
Setting_NInit.Work_OfflineMode = TSAVBean.OpenOfflineMode;
if (WorkType.Equals(1)) if (WorkType.Equals(1))
{ {
...@@ -381,15 +385,18 @@ namespace TSA_V ...@@ -381,15 +385,18 @@ namespace TSA_V
private void CheckIfHaveincomplete() 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) if (DisContinueWorking)
{ {
return; 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); string ProcedureName = Setting_NInit.Work_ProcedureName ;
if (!string.IsNullOrEmpty(ProcedureName)&&!string.IsNullOrEmpty(TagNumber)) int TagNumber = Setting_NInit.Work_TagNumber;
if (!string.IsNullOrEmpty(ProcedureName)&&TagNumber>=0)
{ {
BoardInfo board = BoardManager.getBoardByName(ProcedureName); BoardInfo board = BoardManager.getBoardByName(ProcedureName);
if (board == null) if (board == null)
......
...@@ -70,7 +70,8 @@ namespace TSA_V ...@@ -70,7 +70,8 @@ namespace TSA_V
timerShowForm.Stop(); 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) if (workSmtList.Count > 0&&TagNumber!=0&& isContinue)
{ {
var workSmt = workSmtList.Single(a => a.pointNum == TagNumber); var workSmt = workSmtList.Single(a => a.pointNum == TagNumber);
...@@ -364,12 +365,12 @@ namespace TSA_V ...@@ -364,12 +365,12 @@ namespace TSA_V
private void btnStartWorking_Click(object sender, EventArgs e) private void btnStartWorking_Click(object sender, EventArgs e)
{ {
bool isCy = ConfigAppSettings.GetBoolValue(Setting_Init.IsCycleDebug); //bool isCy = ConfigAppSettings.GetBoolValue(Setting_Init.IsCycleDebug);
LogUtil.info(Name + "点击:" + btnStartWorking.Text + ",自动启动循环测试模式=" + isCy); LogUtil.info(Name + "点击:" + btnStartWorking.Text + ",自动启动循环测试模式=" + Setting_NInit.Device_IsCycleDebug);
btnStartWorking.Enabled = false; btnStartWorking.Enabled = false;
//开始工作 //开始工作
TSAVBean.StartWork(BoardManager.CurrBoard); TSAVBean.StartWork(BoardManager.CurrBoard);
WorkInfo.IsCycleDebug = isCy; WorkInfo.IsCycleDebug = Setting_NInit.Device_IsCycleDebug;
btnStartWorking.Enabled = true; btnStartWorking.Enabled = true;
} }
...@@ -414,7 +415,7 @@ namespace TSA_V ...@@ -414,7 +415,7 @@ namespace TSA_V
else else
{ {
btnStartWorking.Enabled = false; btnStartWorking.Enabled = false;
if (TSAVBean.IsDebug.Equals(false)) if (Setting_NInit.App_IsDebug.Equals(false))
{ {
btnNextPoint.Enabled = false; btnNextPoint.Enabled = false;
btnPrePoint.Enabled = false; btnPrePoint.Enabled = false;
...@@ -612,12 +613,19 @@ namespace TSA_V ...@@ -612,12 +613,19 @@ namespace TSA_V
lblComNotices.Text = ResourceCulture.GetString("元器件数量不足,请及时补充", "元器件数量不足,请及时补充"); lblComNotices.Text = ResourceCulture.GetString("元器件数量不足,请及时补充", "元器件数量不足,请及时补充");
} }
//记录运行过程的位号 //记录运行过程的位号
ConfigAppSettings.UpdateAppSetting(Setting_Init.ProcedureName, board.boardName); //ConfigAppSettings.UpdateAppSetting(Setting_Init.ProcedureName, board.boardName);
ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, smtPoint.pointNum.ToString()); //ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, smtPoint.pointNum.ToString());
if (smtPoint.pointNum==1)//第一个位号不需要记录 //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, ""); Setting_NInit.Work_ProcedureName = "";
ConfigAppSettings.UpdateAppSetting(Setting_Init.TagNumber, ""); Setting_NInit.Work_TagNumber = 0;
} }
#endregion #endregion
} }
...@@ -992,7 +1000,8 @@ namespace TSA_V ...@@ -992,7 +1000,8 @@ namespace TSA_V
{ {
AutoVisiable(true); AutoVisiable(true);
TSAVBean.WorkMode = 1; TSAVBean.WorkMode = 1;
ConfigAppSettings.SaveValue(Setting_Init.WorkMode, 1); //ConfigAppSettings.SaveValue(Setting_Init.WorkMode, 1);
Setting_NInit.Work_WorkMode = 1;
LogUtil.info("切换工作模式为:自动工作"); LogUtil.info("切换工作模式为:自动工作");
} }
else else
...@@ -1007,7 +1016,8 @@ namespace TSA_V ...@@ -1007,7 +1016,8 @@ namespace TSA_V
{ {
AutoVisiable(false); AutoVisiable(false);
TSAVBean.WorkMode = 0; TSAVBean.WorkMode = 0;
ConfigAppSettings.SaveValue(Setting_Init.WorkMode, 0); //ConfigAppSettings.SaveValue(Setting_Init.WorkMode, 0);
Setting_NInit.Work_WorkMode = 0;
LogUtil.info("切换工作模式为:脚踏工作"); LogUtil.info("切换工作模式为:脚踏工作");
} }
else else
...@@ -1034,7 +1044,8 @@ namespace TSA_V ...@@ -1034,7 +1044,8 @@ namespace TSA_V
} }
TSAVBean.AuToModeSeconds = value; 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) MessageBox.Show(ResourceCulture.GetString(ResourceCulture.UpdateTOK, "已更新自动工作时间间隔为{0}秒 ", value)
, ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示")); , ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示"));
} }
......
...@@ -71,7 +71,7 @@ namespace TSA_V ...@@ -71,7 +71,7 @@ namespace TSA_V
} }
LogUtil.info("切换是否统计:" + chbIsWork.Checked); LogUtil.info("切换是否统计:" + chbIsWork.Checked);
WorkCountManager.IsNeedCount = chbIsWork.Checked; WorkCountManager.IsNeedCount = chbIsWork.Checked;
ConfigAppSettings.SaveValue(Setting_Init.IsNeedCount, WorkCountManager.IsNeedCount); Setting_NInit.Work_IsNeedCount= WorkCountManager.IsNeedCount;
} }
} }
} }
...@@ -26,9 +26,9 @@ namespace UserFromControl ...@@ -26,9 +26,9 @@ namespace UserFromControl
{ {
cmbType.SelectedIndex = 0; cmbType.SelectedIndex = 0;
} }
PointSizeX = TSAVBean.DefaultPSize; PointSizeX = Setting_NInit.Device_DefaultPointSize;
PointSizeY = TSAVBean.DefaultPSize; PointSizeY = Setting_NInit.Device_DefaultPointSize;
PointType = TSAVBean.DefaultPType; PointType = Setting_NInit.Device_DefaultPointType;
numSizeX.Maximum = MaxX / 2; numSizeX.Maximum = MaxX / 2;
numSizeY.Maximum=MaxY/ 2; numSizeY.Maximum=MaxY/ 2;
//LogUtil.info($"投影点位范围:X:{MaxX},Y:{MaxY}"); //LogUtil.info($"投影点位范围:X:{MaxX},Y:{MaxY}");
......
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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"> <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> <HintPath>..\packages\MetroFramework-1.3.0.0.1.3.0.0\lib\MetroFramework.dll</HintPath>
<Private>True</Private> <Private>True</Private>
......
此文件类型无法预览
此文件类型无法预览
...@@ -57,17 +57,6 @@ ...@@ -57,17 +57,6 @@
the contents of this method with the code editor. the contents of this method with the code editor.
</summary> </summary>
</member> </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"> <member name="T:ConfigHelper.Config">
<summary> <summary>
自定义配置存取 自定义配置存取
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!