1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using CookComputing.XmlRpc;
- namespace MeasureThread
- {
- /// <summary>
- /// 客户端服务类-> 公共工具类(XmlRpcClient)
- /// </summary>
- public static class XmlRpcClient
- {
- // 访问路径http://localhost:8080/XmlRpcWebServer
- //public static string urlstring = "http://localhost:8019/MathService.ashx";
- /// <summary>
- /// 获取接口:用于调用方法;
- /// </summary>
- /// <param name="urlstr">访问服务器服务类路径</param>
- /// <returns>instance</returns>
- public static IMethod getInstance(string urlstr)
- {
- // 用XmlRpcProxyGen创建接口: 只有此接口实现IXmlRpcProxy接口才能添加url值;
- IMethod service = XmlRpcProxyGen.Create<IMethod>();
- service.Timeout = 5 * 60 * 1000;
- service.XmlEncoding = new System.Text.UTF8Encoding();
- service.Url = urlstr;
- return service;
- }
-
- /// <summary>
- /// 对焦
- /// </summary>
- /// <returns></returns>
- public static string autofocusstig(int search_step, int iter_n, double wd_searh_factor, double stig_range, double iter_range_damping, string urlstr,bool normalized)
- {
- string xrs;
- //调取接口方法
- IMethod method = getInstance(urlstr);
- xrs = method.autofocusstig( search_step, iter_n, wd_searh_factor, stig_range, iter_range_damping,normalized);
- return xrs;
- }
- /// <summary>
- /// 对焦
- /// </summary>
- /// <returns></returns>
- public static string autofocus(int search_step, double wd_searh_factor, double retry, bool refine, string urlstr,bool normalized)
- {
- string xrs;
- //调取接口方法
- IMethod method = getInstance(urlstr);
- xrs = method.autofocus( search_step, wd_searh_factor, retry, refine,normalized);
- return xrs;
- }
- }
- }
|