OTSDelegateEvent.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. using OTSIncAReportApp.OTSSampleReportInfo;
  2. namespace OTSIncAReportApp.OTSDelegateEvent
  3. {
  4. /// <summary>
  5. /// 属性Grid与TreeView进行交互,托管类
  6. /// </summary>
  7. public class DelegateEventFun
  8. {
  9. #region 变量定义
  10. /// <summary>
  11. /// ReportApp全局变量
  12. /// </summary>
  13. private frmReportApp m_ReportApp = null;
  14. /// <summary>
  15. /// MeasureApp 和OTSPropertyWindow 交互样品属性数据(Grid 显示样品属性数据)
  16. /// </summary>
  17. /// <param name="SampleInfo"></param>
  18. public delegate void DAddRep_ResultWindowReqReportApp_EventHandler(OTSSampleMeaInfo SampleInfo);
  19. /// <summary>
  20. /// MeasureApp 和 OTSPropertyWindow 交互样品属性数据(Grid 显示样品属性数据)
  21. /// </summary>
  22. /// <param name="SampleId"></param>
  23. /// <param name="ValType"></param>
  24. /// <param name="index"></param>
  25. /// <param name="ObjVal"></param>
  26. /// <param name="bCheckBoxFlag"></param>
  27. public delegate void WorkingSampleInfo_MeasureAppWithPropWindow_EventHandler(OTS_RETORT_PROP_GRID_ITEMS SampleId, OTS_ITEM_TYPES ValType, int index, object ObjVal, bool bCheckBoxFlag = false);
  28. /// <summary>
  29. /// OTSPropertyWindow 给 MeasureApp 窗口改动的工作样品Grid的样品属性信息请求
  30. /// </summary>
  31. public event WorkingSampleInfo_MeasureAppWithPropWindow_EventHandler WorkingSampleChanged;
  32. #endregion
  33. #region 构造函数
  34. /// <summary>
  35. /// 构造函数
  36. /// </summary>
  37. /// <param name="MeasureAppForm"></param>
  38. public DelegateEventFun(frmReportApp MeasureAppForm)
  39. {
  40. m_ReportApp = MeasureAppForm;
  41. }
  42. #endregion
  43. #region 托管函数
  44. /// <summary>
  45. /// OTSPropertyWindow 给 ReportApp 窗口发送改动的Grid的当前工作样品属性信息请求
  46. /// </summary>
  47. /// <param name="SampleId"></param>
  48. /// <param name="ValType"></param>
  49. /// <param name="index"></param>
  50. /// <param name="ObjVal"></param>
  51. /// <param name="bCheckBoxFlag"></param>
  52. public void Send_WorkingSampleChanged(OTS_RETORT_PROP_GRID_ITEMS SampleId, OTS_ITEM_TYPES ValType, int index, object ObjVal, bool bCheckBoxFlag = false)
  53. {
  54. if (null != WorkingSampleChanged)
  55. {
  56. m_ReportApp.m_LogFunExport.TraceLog(" (OTSDelegateEventFun.Send_WSampleInfo_PropWindowReqMeasureApp_Event_Fun) Send_WSampleInfo_PropWindowReqMeasureApp_Event_Fun Success");
  57. WorkingSampleChanged(SampleId, ValType, index, ObjVal, bCheckBoxFlag);
  58. }
  59. else
  60. {
  61. m_ReportApp.m_LogFunExport.TraceErrorLog(" (OTSDelegateEventFun.Send_WSampleInfo_PropWindowReqMeasureApp_Event_Fun) Send_WSampleInfo_PropWindowReqMeasureApp_Event_Fun Failed");
  62. }
  63. }
  64. #endregion
  65. #region 排除无用代码 2018-8-2
  66. //public delegate void DWSampleInfo_ReportAppWithPropWindow_EventHandler(OTS_RETORT_PROP_GRID_ITEMS SampleId, OTS_ITEM_TYPES ValType, object ObjVal, bool bCheckBoxFlag = false); // MeasureApp 和 OTSPropertyWindow 交互样品属性数据(Grid 显示样品属性数据)
  67. //public delegate void DSampleInfo_MeasureAppWithPropWindow_EventHandler(OTSSampleMeaInfo SampleInfo); // MeasureApp 和OTSPropertyWindow 交互样品属性数据(Grid 显示样品属性数据)
  68. //OTS_SAMPLE_PROP_GRID_ITEMS SampleId: 被修改的当前工作样品属性值的ID。
  69. //object ObjVal:被修改的当前工作样品属性值
  70. //PropGrid显示
  71. // public delegate void DSampleInfo_MeasureAppWithPropWindow_EventHandler(OTSSampleMeaInfo SampleInfo); // MeasureApp 和OTSPropertyWindow 交互样品属性数据(Grid 显示样品属性数据)
  72. //请求添加测量结果
  73. //public delegate void DAddMea_ResultWindowReportApp_EventHandler(); // OTSMeasureRetMgrWindow窗口给ReportApp窗口添加样品请求
  74. // ReportApp 和 树 交互样品信息
  75. //CWorkSampleParam WSampleParam : //ReportApp 给 树 发送添加样品的样品信息
  76. //public delegate void DAddRep_ResultWindowReportApp_EventHandler(CTreeSampleParam TSampleParam); // MeasureApp 给 OTSSolutionWindow 发送工作样品信息
  77. //public event DAddRep_ResultWindowReportApp_EventHandler DAddRep_ResultWindowReqReportApp_Event; // MeasureApp 给 OTSSolutionWindow 发送工作样品信息
  78. //OTS_SAMPLE_PROP_GRID_ITEMS SampleId: 被修改的当前工作样品属性值的ID。
  79. //object ObjVal:被修改的当前工作样品属性值
  80. // ReportApp 和 树 交互样品信息
  81. //CWorkSampleParam WSampleParam : //ReportApp 给 树 发送添加样品的样品信息
  82. //public void Send_AddMea_ResultWindowReqMeasureApp_Event_Fun(CTreeSampleParam TSampleParam)
  83. //{
  84. // if (null != DAddRep_ResultWindowReqReportApp_Event)
  85. // {
  86. // DAddRep_ResultWindowReqReportApp_Event(TSampleParam);
  87. // }
  88. // else
  89. // {
  90. // }
  91. //}
  92. ////DataGrid显示
  93. //public delegate void DataGridInfo_MeasureAppWithPropWindow_EventHandler(OTSSampleMeaInfo SampleInfo); // MeasureApp 和OTSPropertyWindow 交互样品属性数据(Grid 显示样品属性数据)
  94. //public delegate void DDataGridInfo_MeasureAppWithPropWindow_EventHandler(OTS_RETORT_PROP_GRID_ITEMS SampleId, OTS_ITEM_TYPES ValType, object ObjVal, bool bCheckBoxFlag = false); // MeasureApp 和 OTSPropertyWindow 交互样品属性数据(Grid 显示样品属性数据)
  95. // MeasureApp 窗口给 OTSPropertyWindow窗口 Grid显示的样品属性信息
  96. //public void Send_SampleInfo_MeasureAppToPropWindow_Event_Fun(OTSSampleMeaInfo SampleInfo)
  97. //{
  98. // if (null != DSInfo_ReportAppToPropWindow_Event)
  99. // {
  100. // m_ReportApp.m_LogFunExport.TraceLog(" (OTSDelegateEventFun.Send_SampleInfo_MeasureAppToPropWindow_Event_Fun) Send_SampleInfo_MeasureAppToPropWindow_Event_Fun Success");
  101. // DSInfo_ReportAppToPropWindow_Event(SampleInfo);
  102. // }
  103. // else
  104. // {
  105. // m_ReportApp.m_LogFunExport.TraceErrorLog(" (OTSDelegateEventFun.Send_SampleInfo_MeasureAppToPropWindow_Event_Fun) Send_SampleInfo_MeasureAppToPropWindow_Event_Fun Failed");
  106. // }
  107. //}
  108. //// MeasureApp 窗口给 OTSPropertyWindow窗口 Grid显示的样品属性信息
  109. //public void Send_SampleInfo_ReportAppToPropWindow_Event_Fun(OTSSampleMeaInfo SampleInfo)
  110. //{
  111. // if (null != DSInfo_ReportAppToPropWindow_Event)
  112. // {
  113. // DSInfo_ReportAppToPropWindow_Event(SampleInfo);
  114. // }
  115. // else
  116. // {
  117. // }
  118. //}
  119. //树窗口给ReportApp窗口添加测量结果请求
  120. //public void Send_AddMea_ResultWindowReqMeasureApp_Event_Fun()
  121. //{
  122. // if (null != DAddMea_ResultWindowReqMeasureApp_Event)
  123. // {
  124. // DAddMea_ResultWindowReqMeasureApp_Event();
  125. // }
  126. // else
  127. // {
  128. // }
  129. //}
  130. #endregion
  131. }
  132. }