using Global;
using LogNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
///
///
///
namespace ModelBasic
{
///
///
///
///
public class ErrHandler : Error, IErrHandler
{
///
/// 工艺树刷新
///
public Action refreshCraftTree
{
get;
set;
} = null;
///
/// 传递工艺组
///
public Func transmitCraftGroup
{
get;
set;
} = null;
///
/// 传递模型名
///
public Func transmitModelName
{
get;
set;
} = null;
///
/// 非仿真工艺(空工艺),工艺组的传递
///
public Func transmitCraftGroup_UnSim
{
get;
set;
} = null;
///
/// (位置控制器)关闭
///
public Func closeSeatOperationForm
{
get;
set;
} = null;
///
/// (位置控制器)选择模型发送消息
///
public Func currTreeSelectModelHandler_SeatOperation
{
get;
set;
} = null;
///
/// 传递逻辑脚本名称
///
public static Func transitionEditorPageScriptNameUpdate
{
get;
set;
} = null;
///
/// 浏览器发送
/// 20200916
///
private static Action cefSend
{
get;
set;
} = null;
///
/// 浏览器接收
/// 20200916
///
private static Action cefRec
{
get;
set;
} = null;
///
/// 传递项目名称
/// 2020.11.2
///
public static Func projectNameFunc
{
get;
set;
} = null;
///
/// 工艺树刷新
///
public void RefreshCraftTree()
{
if (refreshCraftTree != null)
{
refreshCraftTree();
}
}
///
/// 传递工艺组
///
///
///
public void TransmitCraftGroup(string craftName, int craftCode)
{
if (transmitCraftGroup != null)
{
transmitCraftGroup.Invoke(craftName, craftCode);
}
}
///
/// 传递模型名
///
///
///
public void TransmitModelName(string modelName, int modelCode)
{
if (transmitModelName != null)
{
transmitModelName.Invoke(modelName, modelCode);
}
}
///
/// 非仿真工艺(空工艺),工艺组的传递
///
///
///
public void TransmitCraftGroup_UnSim(string craftName, int craftCode)
{
if (transmitCraftGroup_UnSim != null)
{
transmitCraftGroup_UnSim.Invoke(craftName, craftCode);
}
}
///
/// ErrInfoTransmit
///
///
public void ErrInfoTransmit(string s)
{
if (errInfoTransmit != null)
{
LogisTrac.WriteLog("", s);
errInfoTransmit.Invoke(s);
}
}
///
/// (位置控制器)关闭
///
public void CloseSeatOperationForm()
{
if (closeSeatOperationForm != null)
{
closeSeatOperationForm.Invoke();
}
}
///
/// (位置控制器)选择模型发送消息
///
///
public void CurrTreeSelectModelHandler_SeatOperation(int modelCode, string modelName)
{
if (currTreeSelectModelHandler_SeatOperation != null)
{
currTreeSelectModelHandler_SeatOperation.Invoke(modelCode, modelName);
}
}
///
/// 传递逻辑脚本名称
///
///
public void TransitionEditorPageScriptNameUpdate(int internalVarCode, string internalVarName)
{
if (transitionEditorPageScriptNameUpdate != null)
{
transitionEditorPageScriptNameUpdate.Invoke(internalVarCode, internalVarName);
}
}
///
/// 发送到浏览器
/// 20200916
///
///
public static void CefSend(string str)
{
if (cefSend != null)
{
cefSend.Invoke(str);
}
}
///
/// 浏览器接收
/// 20200916
///
///
public static void CefRec(string str)
{
if (cefRec != null)
{
cefRec.Invoke(str);
}
}
///
/// 传递项目名称 执行
/// 2020.11.2
///
///
public static void ProjectNameFunc(string projectName)
{
if (projectNameFunc != null)
projectNameFunc.Invoke(projectName);
}
///
/// 工艺树刷新 赋予
///
public void RefreshCraftTree_Give(Action f)
{
refreshCraftTree = f;
}
///
/// 传递工艺组 赋予
///
///
///
public void TransmitCraftGroup_Give(Func f)
{
transmitCraftGroup = f;
}
///
/// ErrInfoTransmit_Give
///
///
public void ErrInfoTransmit_Give(ErrInfoHandler f)
{
ErrInfoHandler func = f;
if (errInfoTransmit == null)
{
errInfoTransmit = func;
}
else
{
errInfoTransmit = f;
}
}
///
/// 传递模型名 赋予
///
///
///
public void TransmitModelName_Give(Func f)
{
transmitModelName = f;
}
///
/// 非仿真工艺(空工艺),工艺组的传递 赋予
///
///
///
public void TransmitCraftGroup_UnSim_Give(Func f)
{
transmitCraftGroup_UnSim = f;
}
///
/// (位置控制器)关闭 赋予
///
public void CloseSeatOperationForm_Give(Func f)
{
closeSeatOperationForm = f;
}
///
/// (位置控制器)选择模型发送消息 赋予
///
///
public void CurrTreeSelectModelHandler_SeatOperation_Give(Func f)
{
currTreeSelectModelHandler_SeatOperation = f;
}
///
/// 传递逻辑脚本名称 赋予
///
///
public void TransitionEditorPageScriptNameUpdate_Give(Func f)
{
transitionEditorPageScriptNameUpdate = f;
}
///
/// 发送到浏览器 赋予
/// 20200916
///
///
public static void CefSend_Give(Action f)
{
cefSend = f;
}
///
/// 浏览器接收 赋予
/// 20200916
///
///
public static void CefRec_Give(Action f)
{
cefRec = f;
}
///
/// 传递项目名称 赋予
/// 2020.11.2
///
///
public static void ProjectNameFunc_Give(Func f)
{
projectNameFunc = f;
}
///
/// 工艺树刷新 判断
///
public bool RefreshCraftTree_IsNull()
{
if (refreshCraftTree == null)
return true;
else
return false;
}
///
/// 传递工艺组 判断
///
///
///
public bool TransmitCraftGroup_IsNull()
{
if (transmitCraftGroup == null)
return true;
else
return false;
}
///
/// 传递模型名 判断
///
///
///
public bool TransmitModelName_IsNull()
{
if (transmitModelName == null)
return true;
else
return false;
}
///
/// 非仿真工艺(空工艺),工艺组的传递 判断
///
///
///
public bool TransmitCraftGroup_UnSim_IsNull()
{
if (transmitCraftGroup_UnSim == null)
return true;
else
return false;
}
///
/// (位置控制器)关闭 判断
///
public bool CloseSeatOperationForm_IsNull()
{
if (closeSeatOperationForm == null)
return true;
else
return false;
}
///
/// (位置控制器)选择模型发送消息 判断
///
///
public bool CurrTreeSelectModelHandler_SeatOperation_IsNull()
{
if (currTreeSelectModelHandler_SeatOperation == null)
return true;
else
return false;
}
///
/// 传递逻辑脚本名称 判断
///
///
public bool TransitionEditorPageScriptNameUpdate_IsNull()
{
if (transitionEditorPageScriptNameUpdate == null)
return true;
else
return false;
}
///
/// 发送到浏览器 判断
/// 20200916
///
///
public static bool CefSend_IsNull()
{
if (cefSend == null)
return true;
else
return false;
}
///
/// 浏览器接收 判断
/// 20200916
///
///
public static bool CefRec_IsNull()
{
if (cefRec == null)
return true;
else
return false;
}
///
/// 传递项目名称 判断
/// 2020.11.2
///
///
public static bool ProjectNameFunc_IsNull()
{
if (projectNameFunc == null)
return true;
else
return false;
}
///
///
///
///
public bool ErrInfoTransmit_IsNull()
{
bool b = false;
if (errInfoTransmit == null)
{
b = true;
}
else
{
b = false;
}
return b;
}
}
}