Esempio n. 1
0
        //// <summary>
        /// 创建新的试验
        /// 这里有几个关键步骤:创建管理连接、复制文件、启动文件、实现通讯
        /// </summary>
        /// <param name="uid">用户编号</param>
        /// <param name="type">试验类型</param>
        /// <param name="hrID">华人设定的模板模型编号</param>
        /// <param name="look_uid">如果看其他人的试验,这里写别人的uid,默认不写为0</param>
        /// <param name="motherPathName">被查看的用户路径名称  eg.55_20191206144001New</param>
        /// <returns></returns>
        public ManagerMessage CreateNew_ShiYan(int uid, ShiYanCreateType type, int hrID, string m_Setting_Arguments, int look_uid = 0, string motherPathName = "")
        {
            //
            ManagerMessage r = new ManagerMessage();

            r.ID                  = PublicClassRule.MakeMessageID(YingHeXinList, TCPConnectMax);//运算生成
            r.UID                 = uid;
            r.CreateType          = type;
            r.HR_Make_ID          = hrID;
            r.Status              = ShiYanStatus.New;
            r.Look_Other_UID      = look_uid;
            r.SourceModelPath     = motherPathName;
            r.M_Setting_Arguments = m_Setting_Arguments;

            #region 路径处理
            try
            {
                PublicClassRule.Self_Make_Path(ref r, motherPathName);//根据创建类型,分配相关路径
            }
            catch (Exception e)
            {
                Read_Exception(ref r, e);
            }
            #endregion



            YingHeXinList.Add(r);
            return(r);
        }
Esempio n. 2
0
        public API_Response CreateNew_ShiYan(int uid, ShiYanCreateType type, int hrID, string m_Setting_Arguments, int look_uid, string motherPath)
        {
            API_Response api = new API_Response();

            #region MyRegion
            try
            {
                //Service_Main client = new Service_Main();
                api.Status   = "API正常";
                api.ErrorMsg = "";
                api.Data     = client.CreateNew_ShiYan(uid, type, hrID, m_Setting_Arguments, look_uid, motherPath);
            }
            catch (Exception ex)
            {
                api.Status   = "API异常";
                api.ErrorMsg = ex.Message;
                api.Data     = null;
            }
            #endregion

            return(api);
        }