|
@@ -20,6 +20,7 @@ namespace WebManager
|
|
private String Url = "";
|
|
private String Url = "";
|
|
private const String Post = "Post";
|
|
private const String Post = "Post";
|
|
private const String Content_Type= "Content-Type:application/json";
|
|
private const String Content_Type= "Content-Type:application/json";
|
|
|
|
+ private String[] _url = new string[8];
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
@@ -28,10 +29,11 @@ namespace WebManager
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="ws_ip">WebServer的IP地址</param>
|
|
/// <param name="ws_ip">WebServer的IP地址</param>
|
|
/// <param name="ws_port">WebServer的端口号</param>
|
|
/// <param name="ws_port">WebServer的端口号</param>
|
|
- public WebResult(String ws_ip,String ws_port)
|
|
|
|
|
|
+ public WebResult(String ws_ip,String ws_port,String ws_url)
|
|
{
|
|
{
|
|
this.webServer_IP = ws_ip;
|
|
this.webServer_IP = ws_ip;
|
|
this.webServer_Port = ws_port;
|
|
this.webServer_Port = ws_port;
|
|
|
|
+ this._url = ws_url.Split(',');
|
|
//更新Web网址
|
|
//更新Web网址
|
|
Update_Url();
|
|
Update_Url();
|
|
}
|
|
}
|
|
@@ -96,7 +98,14 @@ namespace WebManager
|
|
/// <returns>json字符串</returns>
|
|
/// <returns>json字符串</returns>
|
|
public void Img_OffsetAngle_Direction(String imagePath, int imageType, String firm, out double degree, out int direction, out int state)
|
|
public void Img_OffsetAngle_Direction(String imagePath, int imageType, String firm, out double degree, out int direction, out int state)
|
|
{
|
|
{
|
|
- this.webServer_Path = "FIB_degree_recognize";
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = this._url[0];
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = "FIB_degree_recognize";
|
|
|
|
+ }
|
|
Update_Url();
|
|
Update_Url();
|
|
JObject json = new JObject();
|
|
JObject json = new JObject();
|
|
json.Add("img_path", imagePath);
|
|
json.Add("img_path", imagePath);
|
|
@@ -129,7 +138,14 @@ namespace WebManager
|
|
/// <returns>json字符串</returns>
|
|
/// <returns>json字符串</returns>
|
|
public void Img_Cut_Position(String imagePath, int imageType, String firm, out double offsetx, out double offsety, out int state)
|
|
public void Img_Cut_Position(String imagePath, int imageType, String firm, out double offsetx, out double offsety, out int state)
|
|
{
|
|
{
|
|
- this.webServer_Path = "test2";
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = this._url[1];
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = "test2";
|
|
|
|
+ }
|
|
Update_Url();
|
|
Update_Url();
|
|
JObject json = new JObject();
|
|
JObject json = new JObject();
|
|
json.Add("img_path", imagePath);
|
|
json.Add("img_path", imagePath);
|
|
@@ -161,7 +177,14 @@ namespace WebManager
|
|
/// <returns>json字符串</returns>
|
|
/// <returns>json字符串</returns>
|
|
public void Img_Cut_Success(String imageBefore, String imageAfter, out int state)
|
|
public void Img_Cut_Success(String imageBefore, String imageAfter, out int state)
|
|
{
|
|
{
|
|
- this.webServer_Path = "FIB_verify";
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = this._url[2];
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = "FIB_verify";
|
|
|
|
+ }
|
|
Update_Url();
|
|
Update_Url();
|
|
JObject json = new JObject();
|
|
JObject json = new JObject();
|
|
json.Add("img_before_path", imageBefore);
|
|
json.Add("img_before_path", imageBefore);
|
|
@@ -185,7 +208,14 @@ namespace WebManager
|
|
/// <returns>json字符串</returns>
|
|
/// <returns>json字符串</returns>
|
|
public void Img_Trapezoid_Top_Center_Position(String imagePath, out double offsetx, out double offsety, out int state)
|
|
public void Img_Trapezoid_Top_Center_Position(String imagePath, out double offsetx, out double offsety, out int state)
|
|
{
|
|
{
|
|
- this.webServer_Path = "test4";
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = this._url[3];
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = "test4";
|
|
|
|
+ }
|
|
Update_Url();
|
|
Update_Url();
|
|
JObject json = new JObject();
|
|
JObject json = new JObject();
|
|
json.Add("img_path", imagePath);
|
|
json.Add("img_path", imagePath);
|
|
@@ -214,7 +244,14 @@ namespace WebManager
|
|
/// <returns>json字符串</returns>
|
|
/// <returns>json字符串</returns>
|
|
public String Img_Auto_Focus(List<String> imagePath)
|
|
public String Img_Auto_Focus(List<String> imagePath)
|
|
{
|
|
{
|
|
- this.webServer_Path = "test5";
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = this._url[4];
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = "test5";
|
|
|
|
+ }
|
|
Update_Url();
|
|
Update_Url();
|
|
JObject json = new JObject();
|
|
JObject json = new JObject();
|
|
for(int i=0;i<imagePath.Count;i++)
|
|
for(int i=0;i<imagePath.Count;i++)
|
|
@@ -240,7 +277,14 @@ namespace WebManager
|
|
/// <returns>json字符串</returns>
|
|
/// <returns>json字符串</returns>
|
|
public String Img_Auto_Stigmatic(List<String> imagePath)
|
|
public String Img_Auto_Stigmatic(List<String> imagePath)
|
|
{
|
|
{
|
|
- this.webServer_Path = "test6";
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = this._url[5];
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = "test6";
|
|
|
|
+ }
|
|
Update_Url();
|
|
Update_Url();
|
|
JObject json = new JObject();
|
|
JObject json = new JObject();
|
|
for (int i = 0; i < imagePath.Count; i++)
|
|
for (int i = 0; i < imagePath.Count; i++)
|
|
@@ -266,7 +310,14 @@ namespace WebManager
|
|
/// <returns>json字符串</returns>
|
|
/// <returns>json字符串</returns>
|
|
public void Img_Center_Position_OffsetAngle_Direction(String imagePath, int imageType, String firm, out double offsetx, out double offsety, out double degree, out int direction, out int state)
|
|
public void Img_Center_Position_OffsetAngle_Direction(String imagePath, int imageType, String firm, out double offsetx, out double offsety, out double degree, out int direction, out int state)
|
|
{
|
|
{
|
|
- this.webServer_Path = "test7";
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = this._url[6];
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = "test7";
|
|
|
|
+ }
|
|
Update_Url();
|
|
Update_Url();
|
|
JObject json = new JObject();
|
|
JObject json = new JObject();
|
|
json.Add("img_path", imagePath);
|
|
json.Add("img_path", imagePath);
|
|
@@ -304,7 +355,14 @@ namespace WebManager
|
|
/// <returns>json字符串</returns>
|
|
/// <returns>json字符串</returns>
|
|
public void Img_Measure_Size(String imagePath, String ratio, String size, out int state)
|
|
public void Img_Measure_Size(String imagePath, String ratio, String size, out int state)
|
|
{
|
|
{
|
|
- this.webServer_Path = "test8";
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = this._url[7];
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ this.webServer_Path = "test8";
|
|
|
|
+ }
|
|
Update_Url();
|
|
Update_Url();
|
|
JObject json = new JObject();
|
|
JObject json = new JObject();
|
|
json.Add("img_path", imagePath);
|
|
json.Add("img_path", imagePath);
|