481 lines
12 KiB
C#
481 lines
12 KiB
C#
using ModelBasic;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Global
|
|
{
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class ProjectVar : TheVar
|
|
{
|
|
/// <summary>
|
|
/// 浏览器发送
|
|
/// 20200916
|
|
/// </summary>
|
|
private static Action<String> cefSend
|
|
{
|
|
get;
|
|
set;
|
|
} = null;
|
|
/// <summary>
|
|
/// 浏览器接收
|
|
/// 20200916
|
|
/// </summary>
|
|
private static Action<String> cefRec
|
|
{
|
|
get;
|
|
set;
|
|
} = null;
|
|
|
|
/// <summary>
|
|
/// 工艺树刷新
|
|
/// </summary>
|
|
public void RefreshCraftTree()
|
|
{
|
|
if (refreshCraftTree != null)
|
|
{
|
|
refreshCraftTree();
|
|
}
|
|
|
|
|
|
}
|
|
/// <summary>
|
|
/// 传递工艺组
|
|
/// </summary>
|
|
/// <param name="craftName"></param>
|
|
/// <param name="craftCode"></param>
|
|
public void TransmitCraftGroup(string craftName, string craftCode)
|
|
{
|
|
if (transmitCraftGroup != null)
|
|
{
|
|
transmitCraftGroup.Invoke(craftName, craftCode);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 传递模型名
|
|
/// </summary>
|
|
/// <param name="modelName"></param>
|
|
/// <param name="modelCode"></param>
|
|
public void TransmitModelName(string modelName, string modelCode)
|
|
{
|
|
if (transmitModelName != null)
|
|
{
|
|
transmitModelName.Invoke(modelName, modelCode);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 非仿真工艺(空工艺),工艺组的传递
|
|
/// </summary>
|
|
/// <param name="craftName"></param>
|
|
/// <param name="craftCode"></param>
|
|
public void TransmitCraftGroup_UnSim(string craftName, string craftCode)
|
|
{
|
|
if (transmitCraftGroup_UnSim != null)
|
|
{
|
|
transmitCraftGroup_UnSim.Invoke(craftName, craftCode);
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// (位置控制器)关闭
|
|
/// </summary>
|
|
public void CloseSeatOperationForm()
|
|
{
|
|
if (closeSeatOperationForm != null)
|
|
{
|
|
closeSeatOperationForm.Invoke();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// (位置控制器)选择模型发送消息
|
|
/// </summary>
|
|
/// <param name="modelName"></param>
|
|
public void CurrTreeSelectModelHandler_SeatOperation(string modelCode, string modelName)
|
|
{
|
|
if (currTreeSelectModelHandler_SeatOperation != null)
|
|
{
|
|
currTreeSelectModelHandler_SeatOperation.Invoke(modelCode, modelName);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 传递逻辑脚本名称
|
|
/// </summary>
|
|
/// <param name="modelName"></param>
|
|
public void TransitionEditorPageScriptNameUpdate(string internalVarCode, string internalVarName)
|
|
{
|
|
if (transitionEditorPageScriptNameUpdate != null)
|
|
{
|
|
transitionEditorPageScriptNameUpdate.Invoke(internalVarCode, internalVarName);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 发送到浏览器
|
|
/// 20200916
|
|
/// </summary>
|
|
/// <param name="str"></param>
|
|
public static void CefSend(string str)
|
|
{
|
|
if (cefSend != null)
|
|
{
|
|
cefSend.Invoke(str);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 浏览器接收
|
|
/// 20200916
|
|
/// </summary>
|
|
/// <param name="str"></param>
|
|
public static void CefRec(string str)
|
|
{
|
|
if (cefRec != null)
|
|
{
|
|
cefRec.Invoke(str);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 工艺树刷新 赋予
|
|
/// </summary>
|
|
public void RefreshCraftTree_Give(Action f)
|
|
{
|
|
refreshCraftTree = f;
|
|
}
|
|
/// <summary>
|
|
/// 传递工艺组 赋予
|
|
/// </summary>
|
|
/// <param name="craftName"></param>
|
|
/// <param name="craftCode"></param>
|
|
public void TransmitCraftGroup_Give(Func<String, String, bool> f)
|
|
{
|
|
transmitCraftGroup = f;
|
|
}
|
|
/// <summary>
|
|
/// 传递模型名 赋予
|
|
/// </summary>
|
|
/// <param name="modelName"></param>
|
|
/// <param name="modelCode"></param>
|
|
public void TransmitModelName_Give(Func<String, String, bool> f)
|
|
{
|
|
transmitModelName = f;
|
|
}
|
|
/// <summary>
|
|
/// 非仿真工艺(空工艺),工艺组的传递 赋予
|
|
/// </summary>
|
|
/// <param name="craftName"></param>
|
|
/// <param name="craftCode"></param>
|
|
public void TransmitCraftGroup_UnSim_Give(Func<String, String, bool> f)
|
|
{
|
|
transmitCraftGroup_UnSim = f;
|
|
|
|
}
|
|
/// <summary>
|
|
/// (位置控制器)关闭 赋予
|
|
/// </summary>
|
|
public void CloseSeatOperationForm_Give(Func<bool> f)
|
|
{
|
|
closeSeatOperationForm = f;
|
|
}
|
|
/// <summary>
|
|
/// (位置控制器)选择模型发送消息 赋予
|
|
/// </summary>
|
|
/// <param name="modelName"></param>
|
|
public void CurrTreeSelectModelHandler_SeatOperation_Give(Func<String, String, bool> f)
|
|
{
|
|
currTreeSelectModelHandler_SeatOperation = f;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 传递逻辑脚本名称 赋予
|
|
/// </summary>
|
|
/// <param name="f"></param>
|
|
public void TransitionEditorPageScriptNameUpdate_Give(Func<String, String, bool> f)
|
|
{
|
|
transitionEditorPageScriptNameUpdate = f;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 发送到浏览器 赋予
|
|
/// 20200916
|
|
/// </summary>
|
|
/// <param name="str"></param>
|
|
public static void CefSend_Give(Action<String> f)
|
|
{
|
|
cefSend = f;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 浏览器接收 赋予
|
|
/// 20200916
|
|
/// </summary>
|
|
/// <param name="str"></param>
|
|
public static void CefRec_Give(Action<String> f)
|
|
{
|
|
cefRec = f;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 工艺树刷新 判断
|
|
/// </summary>
|
|
public bool RefreshCraftTree_IsNull()
|
|
{
|
|
if (refreshCraftTree == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
/// <summary>
|
|
/// 传递工艺组 判断
|
|
/// </summary>
|
|
/// <param name="craftName"></param>
|
|
/// <param name="craftCode"></param>
|
|
public bool TransmitCraftGroup_IsNull()
|
|
{
|
|
if (transmitCraftGroup == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
/// <summary>
|
|
/// 传递模型名 判断
|
|
/// </summary>
|
|
/// <param name="modelName"></param>
|
|
/// <param name="modelCode"></param>
|
|
public bool TransmitModelName_IsNull()
|
|
{
|
|
if (transmitModelName == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
/// <summary>
|
|
/// 非仿真工艺(空工艺),工艺组的传递 判断
|
|
/// </summary>
|
|
/// <param name="craftName"></param>
|
|
/// <param name="craftCode"></param>
|
|
public bool TransmitCraftGroup_UnSim_IsNull()
|
|
{
|
|
if (transmitCraftGroup_UnSim == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
|
|
}
|
|
/// <summary>
|
|
/// (位置控制器)关闭 判断
|
|
/// </summary>
|
|
public bool CloseSeatOperationForm_IsNull()
|
|
{
|
|
if (closeSeatOperationForm == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
/// <summary>
|
|
/// (位置控制器)选择模型发送消息 判断
|
|
/// </summary>
|
|
/// <param name="modelName"></param>
|
|
public bool CurrTreeSelectModelHandler_SeatOperation_IsNull()
|
|
{
|
|
if (currTreeSelectModelHandler_SeatOperation == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 传递逻辑脚本名称 判断
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public bool TransitionEditorPageScriptNameUpdate_IsNull()
|
|
{
|
|
if (transitionEditorPageScriptNameUpdate == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 发送到浏览器 判断
|
|
/// 20200916
|
|
/// </summary>
|
|
/// <param name="str"></param>
|
|
public static bool CefSend_IsNull()
|
|
{
|
|
if (cefSend == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 浏览器接收 判断
|
|
/// 20200916
|
|
/// </summary>
|
|
/// <param name="str"></param>
|
|
public static bool CefRec_IsNull()
|
|
{
|
|
if (cefRec == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 传递项目名称
|
|
/// 2020.11.2
|
|
/// </summary>
|
|
public Func<String, Boolean> projectNameFunc
|
|
{
|
|
get;
|
|
set;
|
|
} = null;
|
|
|
|
/// <summary>
|
|
/// 传递项目名称
|
|
/// 2020.11.2
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public void ProjectNameFunc(string projectName)
|
|
{
|
|
|
|
if (projectNameFunc != null)
|
|
{
|
|
projectNameFunc.Invoke(projectName);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 传递项目名称 赋予
|
|
/// 2020.11.2
|
|
/// </summary>
|
|
/// <param name="f"></param>
|
|
public void ProjectNameFunc_Give(Func<String, Boolean> f)
|
|
{
|
|
projectNameFunc = f;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 传递项目名称 判断
|
|
/// 2020.11.2
|
|
/// </summary>
|
|
/// <param name="f"></param>
|
|
public bool ProjectNameFunc_IsNull()
|
|
{
|
|
if (projectNameFunc == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
|
|
public ShowMainProgressSet showMainProgressSet
|
|
{
|
|
get;
|
|
set;
|
|
} = null;
|
|
public ShowMainProgress showMainProgress
|
|
{
|
|
get;
|
|
set;
|
|
} = null;
|
|
|
|
public ShowMainProgressCountPer showMainProgressCountPer
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
public bool ShowMainProgressSet_IsNull(string n, int m)
|
|
{
|
|
bool b = false;
|
|
if (showMainProgressSet == null)
|
|
{
|
|
b = true;
|
|
}
|
|
else
|
|
{
|
|
b = false;
|
|
}
|
|
return b;
|
|
}
|
|
|
|
public bool ShowMainProgress_IsNull(int c)
|
|
{
|
|
bool b = false;
|
|
if (showMainProgress == null)
|
|
{
|
|
b = true;
|
|
}
|
|
else
|
|
{
|
|
b = false;
|
|
}
|
|
return b;
|
|
}
|
|
public void ShowMainProgressSet_Give(ShowMainProgressSet f)
|
|
{
|
|
showMainProgressSet = f;
|
|
}
|
|
|
|
public void ShowMainProgress_Give(ShowMainProgress f)
|
|
{
|
|
showMainProgress = f;
|
|
}
|
|
public void ShowMainProgress_Give_CountPer(ShowMainProgressCountPer f)
|
|
{
|
|
showMainProgressCountPer = f;
|
|
}
|
|
|
|
public void ShowMainProgressSet(string n, int m)
|
|
{
|
|
if(showMainProgressSet!=null)
|
|
{
|
|
|
|
}
|
|
showMainProgressSet.Invoke(n, m);
|
|
}
|
|
|
|
public void ShowMainProgress(int c)
|
|
{
|
|
showMainProgress.Invoke(c);
|
|
}
|
|
public void ShowMainProgressCountPer(string msg,int c)
|
|
{
|
|
showMainProgressCountPer.Invoke(msg,c);
|
|
}
|
|
}
|
|
}
|