Commit 43974366 LN

配置修改

1 个父辈 693f71b1
......@@ -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" />
......
......@@ -10,15 +10,16 @@ namespace TSA_V.Common
/// 记录配置的key
/// </summary>
public class Setting_Init
{
/// <summary>
/// 1时自动启动,并隐藏窗口,=0时不需要
/// </summary>
public static string App_AutoRun = "App_AutoRun";
{
//public static string PUSICAN_Position = "PUSICAN_Position";
/// <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";
......@@ -28,32 +29,22 @@ namespace TSA_V.Common
/// 保存图片地址
/// </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";
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";
......@@ -65,37 +56,74 @@ namespace TSA_V.Common
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";
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 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";
/// <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 SolderingLedIP = "SolderingLedIP";
public static string SolderingLedIndex = "SolderingLedIndex";
public static string CameraName = "CameraName";
/// <summary>
/// 是否需要进行AOI检测
/// </summary>
......@@ -111,43 +139,20 @@ namespace TSA_V.Common
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";
......@@ -184,7 +189,7 @@ namespace TSA_V.Common
public static string DisContinueWorking = "DisContinueWorking";
public static string DisShowScreenAlarm = "DisShowScreenAlarm";
/// <summary>
/// 投影屏幕索引,默认1
/// </summary>
......
......@@ -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>
......
......@@ -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;
}
......
......@@ -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)
{
......
......@@ -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();
......
......@@ -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");
......
......@@ -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>
/// 板子列表
......
......@@ -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;
}
}
}
......@@ -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;
......
......@@ -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 || 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
......@@ -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);
......
......@@ -274,7 +274,7 @@ namespace TSA_V.DeviceLibrary
}
else if (LineStep.IsStep(StepEnum.LS04_StopLine))
{
if (SideCylinderMoveFirst)
if (Setting_NInit.Device_SideCylinderMoveFirst)
{
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 (needCode)
//bool needCode = ConfigAppSettings.GetBoolValue(Setting_Init.NeedPCBCode);
if (Setting_NInit.Device_NeedPCBCode)
{
LineStep.NextStep(StepEnum.LS08_WaitCode);
LineLog("流水线转动:停止流水线,等待输入二维码");
......
......@@ -52,7 +52,7 @@ namespace TSA_V.DeviceLibrary
if (isContinue)
{
LogUtil.info("开始程序【" + boardInfo.boardName + "】的插件 , 继续之前的工作,索引号="+currIndex);
currIndex = ConfigAppSettings.GetIntValue(Setting_Init.TagNumber);
currIndex = Convert.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);
......
......@@ -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;
......@@ -51,9 +52,10 @@ namespace TSA_V.DeviceLibrary
/// <param name="url"></param>
/// <returns></returns>
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))
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -64,11 +64,11 @@ namespace TSA_V
if (smtPoint.PointSizeX < 1 || smtPoint.PointSizeX > 255)
{
smtPoint.PointSizeX = TSAVBean.DefaultPSize;
smtPoint.PointSizeX = Setting_NInit.Device_DefaultPointSize;
}
if (smtPoint.PointSizeY < 1 || smtPoint.PointSizeY > 255)
{
smtPoint.PointSizeY = TSAVBean.DefaultPSize;
smtPoint.PointSizeY = Setting_NInit.Device_DefaultPointSize;
}
//smtPoint.PointSize = 4;
//smtPoint.NodePositionX = BPoint.NodePositionX - (BPoint.NodePositionX - APoint.NodePositionX) * (BPoint.PositionX - smtPoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
......
......@@ -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;
......
......@@ -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
......@@ -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.DefaultPType - 1;
int value= Setting_NInit.Device_DefaultPointType - 1;
if (cmbBoardList.Items.Count > value && value >= 0)
{
cmbBoardList.SelectedIndex = value;
}
numSizeX.Text = TSAVBean.DefaultPSize.ToString();
numSizeY.Text = TSAVBean.DefaultPSize.ToString();
txtAddr.Text = ConfigAppSettings.GetValue(Setting_Init.DCSServerAddr);
numSizeX.Text = Setting_NInit.Device_DefaultPointSize.ToString();
numSizeY.Text = Setting_NInit.Device_DefaultPointSize.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());
}
}
}
}
......@@ -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();
}
}
......
......@@ -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)
......
......@@ -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);
......
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();
......
......@@ -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>
......
......@@ -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));
}
......
......@@ -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;
......
......@@ -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();
......
......@@ -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)
......
......@@ -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, "提示"));
}
......
......@@ -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;
}
}
}
......@@ -26,9 +26,9 @@ namespace UserFromControl
{
cmbType.SelectedIndex = 0;
}
PointSizeX = TSAVBean.DefaultPSize;
PointSizeY = TSAVBean.DefaultPSize;
PointType = TSAVBean.DefaultPType;
PointSizeX = Setting_NInit.Device_DefaultPointSize;
PointSizeY = Setting_NInit.Device_DefaultPointSize;
PointType = Setting_NInit.Device_DefaultPointType;
numSizeX.Maximum = MaxX / 2;
numSizeY.Maximum=MaxY/ 2;
//LogUtil.info($"投影点位范围:X:{MaxX},Y:{MaxY}");
......
......@@ -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>
......
此文件类型无法预览
此文件类型无法预览
......@@ -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!