|
|
|
@ -125,30 +125,32 @@ namespace SparkClient.Model.Services |
|
|
|
int lightLevel = 0; |
|
|
|
int lightLevel = 0; |
|
|
|
string halfCircle = string.Empty; |
|
|
|
string halfCircle = string.Empty; |
|
|
|
// 查询光照度和半圆配置 |
|
|
|
// 查询光照度和半圆配置 |
|
|
|
string sql = $"SELECT KEY, VALUE FROM CUTTER_CONFIG WHERE KEY IN ('light_level', 'half_circle')"; |
|
|
|
string sql = $"SELECT KEY, VALUE FROM CUTTER_CONFIG "; |
|
|
|
DataTable table = DataBaseHelper.ExecuteQuery(sql); |
|
|
|
DataTable table = DataBaseHelper.ExecuteQuery(sql); |
|
|
|
|
|
|
|
|
|
|
|
if (table == null || table.Rows.Count == 0) |
|
|
|
if (table == null || table.Rows.Count == 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
throw new Exception("No data found for the specified keys."); |
|
|
|
throw new Exception("No data found for the specified keys."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
StringBuilder sbParams = new StringBuilder(); |
|
|
|
foreach (DataRow row in table.Rows) |
|
|
|
foreach (DataRow row in table.Rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
string key = row["Key"].ToString() ?? string.Empty; |
|
|
|
string key = row["Key"].ToString() ?? string.Empty; |
|
|
|
string value = row["Value"].ToString() ?? string.Empty; |
|
|
|
string value = row["Value"].ToString() ?? string.Empty; |
|
|
|
|
|
|
|
|
|
|
|
if (key == "light_level" && int.TryParse(value, out int parsedLightLevel)) |
|
|
|
// if (key == "light_level" && int.TryParse(value, out int parsedLightLevel)) |
|
|
|
{ |
|
|
|
// { |
|
|
|
lightLevel = parsedLightLevel; // 光照度 |
|
|
|
// lightLevel = parsedLightLevel; // 光照度 |
|
|
|
} |
|
|
|
// } |
|
|
|
else if (key == "half_circle") |
|
|
|
// else if (key == "half_circle") |
|
|
|
{ |
|
|
|
// { |
|
|
|
halfCircle = value; // 半圆 |
|
|
|
// halfCircle = value; // 半圆 |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
sbParams.Append($"{key}={value}&"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
string url = $"{_baseUrl}/collect_images?light_level={lightLevel}&half_circle={halfCircle}"; |
|
|
|
// string url = $"{_baseUrl}/collect_images?light_level={lightLevel}&half_circle={halfCircle}"; |
|
|
|
|
|
|
|
string url = $"{_baseUrl}/collect_images?{sbParams.ToString().Substring(0, sbParams.ToString().Length - 1)}"; |
|
|
|
|
|
|
|
|
|
|
|
var response = await SendGetRequestAsync<ResponseStatus>(url); |
|
|
|
var response = await SendGetRequestAsync<ResponseStatus>(url); |
|
|
|
|
|
|
|
|
|
|
|
@ -196,7 +198,7 @@ namespace SparkClient.Model.Services |
|
|
|
int lightLevel = 0; |
|
|
|
int lightLevel = 0; |
|
|
|
string halfCircle = string.Empty; |
|
|
|
string halfCircle = string.Empty; |
|
|
|
// 查询光照度和半圆配置 |
|
|
|
// 查询光照度和半圆配置 |
|
|
|
string sql = $"SELECT KEY, VALUE FROM CUTTER_CONFIG WHERE KEY IN ('light_level', 'half_circle')"; |
|
|
|
string sql = $"SELECT KEY, VALUE FROM CUTTER_CONFIG "; |
|
|
|
DataTable table = DataBaseHelper.ExecuteQuery(sql); |
|
|
|
DataTable table = DataBaseHelper.ExecuteQuery(sql); |
|
|
|
|
|
|
|
|
|
|
|
if (table == null || table.Rows.Count == 0) |
|
|
|
if (table == null || table.Rows.Count == 0) |
|
|
|
|