Exeption handling

This commit is contained in:
Szymon Porwolik
2019-02-23 18:29:55 +01:00
parent 02eebc5f1e
commit cc30d305d5

View File

@@ -354,32 +354,57 @@ namespace Perun_v1
private void tim_10000ms_Tick(object sender, EventArgs e) private void tim_10000ms_Tick(object sender, EventArgs e)
{ {
// Main timer to send JSON files to MySQL // Main timer to send JSON files to MySQL
string strSRSJson; string strSRSJson ="";
string strLotATCJson; string strLotATCJson="";
bool SRSdefault = true;
bool LotATCdefault = true;
if (con_check_3rd_srs.Checked) if (con_check_3rd_srs.Checked)
{ {
strSRSJson = System.IO.File.ReadAllText(con_txt_3rd_srs.Text); try
LogHistoryAdd(ref LogHistory, "SRS data loaded"); {
strSRSJson = "{'type':'100','payload':'" + strSRSJson + "'}"; strSRSJson = System.IO.File.ReadAllText(con_txt_3rd_srs.Text);
JsonConvert.DeserializeObject(strSRSJson);
LogHistoryAdd(ref LogHistory, "SRS data loaded");
strSRSJson = "{'type':'100','payload':'" + strSRSJson + "'}";
SRSdefault = false;
}
catch
{
}
} }
else if(SRSdefault)
{ {
strSRSJson = "{'type':'100','payload':{'ignore':'true'}}"; strSRSJson = "{'type':'100','payload':{'ignore':'true'}}";
} }
SendToMySql(strSRSJson); SendToMySql(strSRSJson);
if (con_check_3rd_lotatc.Checked) if (con_check_3rd_lotatc.Checked)
{ {
strLotATCJson = System.IO.File.ReadAllText(con_txt_3rd_lotatc.Text); try
LogHistoryAdd(ref LogHistory, "LotATC data loaded"); {
strLotATCJson = "{'type':'101','payload':'" + strLotATCJson + "'}"; strLotATCJson = System.IO.File.ReadAllText(con_txt_3rd_lotatc.Text);
JsonConvert.DeserializeObject(strLotATCJson);
LogHistoryAdd(ref LogHistory, "LotATC data loaded");
strLotATCJson = "{'type':'101','payload':'" + strLotATCJson + "'}";
}
catch
{
} else }
}
if (LotATCdefault)
{ {
strLotATCJson = "{'type':'101','payload':{'ignore':'true'}}"; strLotATCJson = "{'type':'101','payload':{'ignore':'true'}}";
} }
SendToMySql(strLotATCJson); SendToMySql(strLotATCJson);
} }
} }
} }