using Global;
using KinematicsBase;
using System;
using System.Collections.Generic;
using System.Threading;
///
/// 项目参数
/// 2021.5.25
/// 2021.12.22
///
public class PP
{
#region SystemUser
///
///
///
public static string UserID
{
get;
set;
} = "";
///
///
///
public static string UserName
{
get;
set;
} = "";
///
///
///
public static string UserPassword
{
get;
set;
} = "";
///
///
///
public static Type_Jurisdiction Jurisdiction
{
get;
set;
} = Type_Jurisdiction.Administrator;
///
///
///
public static List ProjectList
{
get;
set;
} = new List ();
#endregion
#region Current Operation Data
///
/// 设备类型的代码
///
public static DeviceType DeviceTypeCode = DeviceType.Device;
///
/// 当前的Web模型代码
///
public static string ModelCode = "-1";
///
/// 当前的Web模型名称
///
public static string ModelName = "-1";
///
/// 当前的Web模型代码
///
public static string ModelCodeBase = "-1";
///
/// 当前的Web模型名称
///
public static string ModelNameBase = "-1";
///
/// 当前的Web模型代码
///
public static string ModelCodeTool = "-1";
///
/// 当前的Web模型名称
///
public static string ModelNameTool = "-1";
///
/// 当前的Web模型代码
///
public static string ModelCodeTcp = "-1";
///
/// 当前的Web模型名称
///
public static string ModelNameTcp = "-1";
///
/// 当前的Web模型位置X
///
public static double TX = 0;
///
/// 当前的Web模型位置Y
///
public static double TY = 0;
///
/// 当前的Web模型位置Z
///
public static double TZ = 0;
///
/// 当前的Web模型位置RX
///
public static double RX = 0;
///
/// 当前的Web模型位置RY
///
public static double RY = 0;
///
/// 当前的Web模型位置RZ
///
public static double RZ = 0;
///
/// 当前的Web模型位置QX
///
public static double QX = 0;
///
/// 当前的Web模型位置QY
///
public static double QY = 0;
///
/// 当前的Web模型位置QZ
///
public static double QZ = 0;
///
/// 当前的Web模型位置QW
///
public static double QW = 0;
///
/// 当前的Web_Base模型位置X
///
public static double TX_Base = 0;
///
/// 当前的Web_Base模型位置Y
///
public static double TY_Base = 0;
///
/// 当前的Web_Base模型位置Z
///
public static double TZ_Base = 0;
///
/// 当前的Web_Base模型位置RX
///
public static double RX_Base = 0;
///
/// 当前的Web_Base模型位置RY
///
public static double RY_Base = 0;
///
/// 当前的Web_Base模型位置RZ
///
public static double RZ_Base = 0;
///
/// 当前的Web_Base模型位置QX
///
public static double QX_Base = 0;
///
/// 当前的Web_Base模型位置QY
///
public static double QY_Base = 0;
///
/// 当前的Web_Base模型位置QZ
///
public static double QZ_Base = 0;
///
/// 当前的Web_Base模型位置QW
///
public static double QW_Base = 0;
///
/// 当前的Web_Tool模型位置X
///
public static double TX_Tool = 0;
///
/// 当前的Web_Tool模型位置Y
///
public static double TY_Tool = 0;
///
/// 当前的Web_Tool模型位置Z
///
public static double TZ_Tool = 0;
///
/// 当前的Web_Tool模型位置RX
///
public static double RX_Tool = 0;
///
/// 当前的Web_Tool模型位置RY
///
public static double RY_Tool = 0;
///
/// 当前的Web_Tool模型位置RZ
///
public static double RZ_Tool = 0;
///
/// 当前的Web_Tool模型位置QX
///
public static double QX_Tool = 0;
///
/// 当前的Web_Tool模型位置QY
///
public static double QY_Tool = 0;
///
/// 当前的Web_Tool模型位置QZ
///
public static double QZ_Tool = 0;
///
/// 当前的Web_Tool模型位置QW
///
public static double QW_Tool = 0;
///
/// 当前的Web_Tcp模型位置X
///
public static double TX_Tcp = 0;
///
/// 当前的Web_Tcp模型位置Y
///
public static double TY_Tcp = 0;
///
/// 当前的Web_Tcp模型位置Z
///
public static double TZ_Tcp = 0;
///
/// 当前的Web_Tcp模型位置RX
///
public static double RX_Tcp = 0;
///
/// 当前的Web_Tcp模型位置RY
///
public static double RY_Tcp = 0;
///
/// 当前的Web_Tcp模型位置RZ
///
public static double RZ_Tcp = 0;
///
/// 当前的Web_Tcp模型位置QX
///
public static double QX_Tcp = 0;
///
/// 当前的Web_Tcp模型位置QY
///
public static double QY_Tcp = 0;
///
/// 当前的Web_Tcp模型位置QZ
///
public static double QZ_Tcp = 0;
///
/// 当前的Web_Tcp模型位置QW
///
public static double QW_Tcp = 0;
#endregion
#region Param
public static bool ReLoadPara_IsCompleted
{
get;
set;
} = false;
///
/// 项目配置参数
/// 2021.10.17.LLX
///
public static PCP_Json PCP
{
get;
set;
}
///
/// 数据库链接
///
public static string ConnectionStr
{
get;
set;
} = "-1";
public static string Url_WebApi
{
get;
set;
} = "http://localhost:41181";
public static string Url_WebApi2
{
get;
set;
} = "http://localhost:41182";
///
/// 项目代码
///
public static string ProjectCode
{
get;
set;
} = "-1";
public static string IsWebApp
{
get;
set;
} = System.Configuration.ConfigurationManager.AppSettings["IsWebApp"];
///
/// 项目名称
///
public static string ProjectName
{
get;
set;
} = "-1";
///
/// 程序的运行模式
/// 2021.12.3.LLX
///
public static Mode_Run RunMode
{
get;
set;
} = Mode_Run.Simulation;
///
///
///
public static string currCefDownLoadPath
{
get;
set;
} = "";
///
/// 允许机器人计算
///
public static bool AllowRobotCalculation
{
get;
set;
} = true;
///
/// 生成工艺序列的全局帧值
/// 2021.5.24
///
public static int gFrameValue
{
get;
set;
} = 0;
#endregion
#region Collections Generic
///
/// 模型列表
///
public static System.Data.DataTable gDT_ModelTree
{
get;
set;
} = null;
///
/// 模型代码对应的模型属性
///
public static Dictionary DC_ModelCode_ModelAttribute
{
get;
set;
} = null;
///
/// 工艺执行任务
///
public static Dictionary dc_Craft_ExecTask
{
get;
set;
} = new Dictionary();
public static System.Collections.Generic.Dictionary DC_TagID_CurrValue
{
get;
set;
} = null;
///
/// TagID触发时候的内容
/// 2021.12.21.LLX
///
public static Dictionary>> dc_TagID_Content
{
get;
set;
} = null;
///
/// 当前的微分点记录
/// 2021.3.29
///
public static System.Collections.Generic.List pList_g
{
get;
set;
} = null;
///
/// 当前逆解的的记录
/// 2021.3.29
///
public static System.Collections.Generic.List> jList_g
{
get;
set;
} = null;
///
///
///
public static Dictionary DC_ResourcesCode_LogicalBlockBasic = new Dictionary();
#endregion
#region DebugOption
///
/// 允许外部查看模型
/// 2021.5.11
///
public static bool g_AllowSelectModel = false;
///
/// 允许外部查看工艺
/// 2021.5.11
///
public static bool g_AllowSelectCraft = false;
///
/// 允许外部查看TagID绑定的信号
/// 2021.5.11
///
public static bool g_AllowSelectTagIDSignal = false;
///
/// 允许控制工艺
///
public static bool g_AllowControlCraft = true;
///
/// 允许控制信号
///
public static bool g_AllowControlSignal = true;
///
/// 允许控制显隐
///
public static bool g_AllowControlVisible = true;
///
/// 允许控制自转
///
public static bool g_AllowControlRotation = true;
///
/// 允许控制等待
/// 2021.11.04.1652.LLX
///
public static bool g_AllowControlWait = true;
#endregion
#region Messy
///
/// 全球变量的接口
///
public static IGlobalVar iGlobalVar = null;
///
/// 允许执行关闭窗体
///
public static bool isCanClose = false;
///
/// 加载完成
///
public static bool LoadFinish = false;
///
/// 是同步顺序,或起始时间排序
///
public static bool ActGantt_Is_SyncOrder_Or_StartTime = true;
///
/// 当前执行的路径
///
public static string currExecPath = "";
#endregion
#region CraftTree
///
/// 当前选中的工艺代码
///
public static string currTreeCraftCode = "-1";
///
/// 当前选中的工艺名称
///
public static string currTreeCraftName = "-1";
///
/// 当前选中的工艺父节点
///
public static string currTreeCraftTypeCode = "-1";
///
/// 当前选中的工艺驱动类型
///
public static Type_Craft currTreeCraftDeviceTypeCode = Type_Craft.LinearFlow;
///
/// 当前选中的工艺的模型代码
///
public static string currCraftTree_ModelCode = "-1";
///
/// 当前选中的工艺的模型名称
///
public static string currCraftTree_ModelName = "-1";
#endregion
#region DeviceSignalSimTree
///
/// 当前选中的设备信号仿真代码
///
public static string currTreeDeviceSignalSimCode = "-1";
///
/// 当前选中的设备信号仿真名称
///
public static string currTreeDeviceSignalSimName = "-1";
#endregion
#region MesWork
public static string BasicDataTableFile = "";
public static int IsDemoMesServer = 0;
public static int IsWriteMonitorLog = 1;
#endregion
#region P_KinematicsEditorDevice PoseCreator
public static int PoseCreatorStepLength = 1;
#endregion
#region Func
///
/// 模型代码找到模型属性
/// 2021.12.22.LLX
///
///
///
public static ModelAttribute ModelCodeFindModelAttribute(string modelCode)
{
ModelAttribute ma = new ModelAttribute() { ModelName = "不存在这个模型" };
if (PP.DC_ModelCode_ModelAttribute == null)
{
return ma;
}
if (PP.DC_ModelCode_ModelAttribute.ContainsKey(modelCode))
{
ma = PP.DC_ModelCode_ModelAttribute[modelCode];
}
return ma;
}
public static List ReturnKinematicsList()
{
var kL = new List();
if (PP.DC_ModelCode_ModelAttribute == null)
{
return kL;
}
foreach (ModelAttribute item in DC_ModelCode_ModelAttribute.Values)
{
if (item != null)
{
if (item.KinematicsData != null)
{
kL.Add(item.KinematicsData);
}
}
}
return kL;
}
public static Kinematics ReturnKinematics(string modelCode)
{
Kinematics k = null;
if (PP.DC_ModelCode_ModelAttribute == null)
{
return k;
}
if (DC_ModelCode_ModelAttribute.ContainsKey(modelCode))
{
k = new Kinematics();
k = DC_ModelCode_ModelAttribute[modelCode].KinematicsData;
}
return k;
}
#endregion
}
/////
///// 项目配置参数
///// 2021.10.17.LLX
/////
//public class PCP
//{
// ///
// /// 导出序列的帧值
// ///
// public static int FrameValue
// {
// get;
// set;
// } = -1;
// ///
// /// 发送数据时间间隔
// ///
// public static int SendInterval
// {
// get;
// set;
// } = -1;
// ///
// /// 通讯服务URL(CS)
// ///
// public static string ConnSvrURL
// {
// get;
// set;
// } = "-1";
// ///
// /// 通讯标头(CS)
// ///
// public static string Prefix
// {
// get;
// set;
// } = "-1";
// ///
// /// 通讯项目标头(CS)
// ///
// public static string ObjectHeader
// {
// get;
// set;
// } = "-1";
// ///
// /// 通讯服务URL(BS)
// ///
// public static string ConnSvrURLBS
// {
// get;
// set;
// } = "-1";
// ///
// /// 通讯标头(BS)
// ///
// public static string PrefixBS
// {
// get;
// set;
// } = "-1";
// ///
// /// 通讯项目标头(BS)
// ///
// public static string ObjectHeaderBS
// {
// get;
// set;
// } = "-1";
// ///
// /// OPC连接的URL
// ///
// public static string OpcUrl
// {
// get;
// set;
// } = "-1";
// ///
// /// 三维网页的URL
// ///
// public static string WebUrl
// {
// get;
// set;
// } = "-1";
// ///
// /// 三维网页文件的路径
// ///
// public static string WebFilePath
// {
// get;
// set;
// } = "-1";
// ///
// /// 程序启用Chrome浏览器
// ///
// public static bool IsStartChrome
// {
// get;
// set;
// } = true;
// ///
// /// 使用服务器通讯方式
// ///
// public static string ConnMode
// {
// get;
// set;
// } = "1";
// ///
// /// 是允许修改模型可见性
// ///
// public static bool IsAllowVisible
// {
// get;
// set;
// } = true;
// ///
// /// 是修改数据库模型可见性
// ///
// public static bool IsUpdateSqlVisible
// {
// get;
// set;
// } = false;
// ///
// /// 是记录现场真实数据
// ///
// public static bool IsRecordData
// {
// get;
// set;
// } = false;
// ///
// /// 行为附加状态数据
// ///
// public static bool ActAttachStateData
// {
// get;
// set;
// } = true;
// ///
// /// 模型文件路径
// ///
// public static string ModelFilePath
// {
// get;
// set;
// } = "";
//}
///
/// 项目配置参数
/// 2021.10.17.LLX
///
public class PCP_Json
{
///
///
///
public PCP_Json()
{
WebUrl = System.Configuration.ConfigurationManager.AppSettings["WebUrl"];
ConnSvrURL = System.Configuration.ConfigurationManager.AppSettings["ConnSvrURL"];
ConnSvrURLBS = System.Configuration.ConfigurationManager.AppSettings["ConnSvrURLBS"];
PrefixBS = System.Configuration.ConfigurationManager.AppSettings["PrefixBS"];
WebFilePath = System.Configuration.ConfigurationManager.AppSettings["WebFilePath"];
SqlBakPath = System.Configuration.ConfigurationManager.AppSettings["SqlBakPath"];
}
///
/// 导出序列的帧值
///
public int FrameValue
{
get;
set;
} = 20;
///
/// 发送数据时间间隔
///
public int SendInterval
{
get;
set;
} = 20;
///
/// 通讯服务URL(CS)
///
public string ConnSvrURL
{
get;
set;
} = "127.0.0.1:41102,OP1010";
///
/// 通讯标头(CS)
///
public string Prefix
{
get;
set;
} = "TOBS??SCADAMain?";
///
/// 通讯项目标头(CS)
///
public string ObjectHeader
{
get;
set;
} = "DT";
///
/// 通讯服务URL(BS)
///
public string ConnSvrURLBS
{
get;
set;
} = "127.0.0.1:61101,SCADAMain";
///
/// 通讯标头(BS)
///
public string PrefixBS
{
get;
set;
} = "TOCS??OP1010?";
///
/// 通讯项目标头(BS)
///
public string ObjectHeaderBS
{
get;
set;
} = "DT";
/////
///// OPC连接的URL
/////
//public string OpcUrl
//{
// get;
// set;
//} = "127.0.0.1:41102,OP1020";
///
/// 三维网页的URL
///
public string WebUrl
{
get;
set;
} = "http://192.168.1.188:1257/editor/index_RobotPlan.html";
///
/// 三维网页文件的路径
///
public string WebFilePath
{
get;
set;
} = @"C:\00-资料夹\DT_WebFile\00-DT_";
///
/// 程序启用Chrome浏览器
///
public bool IsStartChrome
{
get;
set;
} = true;
///
/// 使用服务器通讯方式
///
public bool ConnMode
{
get;
set;
} = true;
///
/// 是允许修改模型可见性
///
public bool IsAllowVisible
{
get;
set;
} = true;
///
/// 是记录现场真实数据
///
public bool IsRecordData
{
get;
set;
} = false;
/////
///// 行为附加状态数据
/////
//public bool ActAttachStateData
//{
// get;
// set;
//} = true;
///
/// 模型文件路径
///
public string ModelFilePath
{
get;
set;
} = "";
///
/// 数据库备份的路径
/// 2021.12.3.LLX
///
public string SqlBakPath
{
get;
set;
} = @"C:\mwdf_bak";
///
/// 是虚拟的PLC模式
/// 2021.12.3.LLX
///
public bool IsPlcSim
{
get;
set;
} = true;
}