Typo refresh + loggging refresh
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
[*.cs]
|
||||
|
||||
# CA1031: Non rilevare tipi di eccezione generali
|
||||
dotnet_diagnostic.CA1031.severity = none
|
||||
|
||||
# CA1303: Non passare valori letterali come parametri localizzati
|
||||
dotnet_diagnostic.CA1303.severity = none
|
||||
@@ -7,6 +7,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LPA", "LPA\LPA.csproj", "{F
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersGen", "VersGen\VersGen.csproj", "{58E399F3-9D4E-49D3-AB35-9ED536543D50}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8A16CC40-FAB6-4BF5-8AC8-7B7AB1A27C66}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="appName" value="LPA" />
|
||||
<!-- conf server comunicazione x NKC Ufficio -->
|
||||
<!--<add key="serverBaseAddr" value="http://iis02/NKC/" />-->
|
||||
<!-- conf server comunicazione x dev MP-MAG -->
|
||||
|
||||
@@ -198,6 +198,9 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="..\.editorconfig">
|
||||
<Link>.editorconfig</Link>
|
||||
</None>
|
||||
<None Include="reports\DemoA4.rdlc">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
+41
-12
@@ -87,7 +87,8 @@ namespace LPA
|
||||
|
||||
private void myInit()
|
||||
{
|
||||
Log.Instance.Info("Avvio applicazione");
|
||||
utils.lgInfo("Starting app");
|
||||
lblAppName.Text = memLayer.ML.CRS("appName");
|
||||
spoolerRun = true;
|
||||
setupConf();
|
||||
setupTimers();
|
||||
@@ -254,7 +255,7 @@ namespace LPA
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Instance.Error(exc, "Errore in decodifica file queueSetup");
|
||||
utils.lgError("Error in deserialization of queueSetupJson file", exc);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
@@ -310,7 +311,7 @@ namespace LPA
|
||||
private void MainTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
// effettuo chiamata coda stampa...
|
||||
refreshQueueStsatus();
|
||||
refreshQueueStatus();
|
||||
// aggiorno visualizzazione
|
||||
updateDGV();
|
||||
}
|
||||
@@ -429,7 +430,7 @@ namespace LPA
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Instance.Error(exc, $"Impossibile associare alla coda {currQueue} la stampante richiesta: {queueSetupConf[currQueue]}");
|
||||
utils.lgError($"Impossible to associate to queue {currQueue} requested printer: {queueSetupConf[currQueue]}", exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -459,7 +460,7 @@ namespace LPA
|
||||
// salvo!
|
||||
queueSetupJson = queueSetupConf;
|
||||
btnSetQueuePrinter.Visible = false;
|
||||
Log.Instance.Info("Salvata nuova conf stampanti");
|
||||
utils.lgInfo("Salvata nuova conf stampanti");
|
||||
updateDGV();
|
||||
}
|
||||
|
||||
@@ -502,6 +503,8 @@ namespace LPA
|
||||
filePath = $"{baseDir}demo\\{coda.Key}.json";
|
||||
rawData = File.ReadAllText(filePath);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
try
|
||||
{
|
||||
// deserializzo
|
||||
List<reportData> report2print = JsonConvert.DeserializeObject<List<reportData>>(rawData);
|
||||
@@ -565,6 +568,11 @@ namespace LPA
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
utils.lgError("Error in deserialization during btnDemoPrint_Click", exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -607,6 +615,8 @@ namespace LPA
|
||||
|
||||
rawData = taskRes.Result;
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
try
|
||||
{
|
||||
// deserializzo
|
||||
objFiles = JsonConvert.DeserializeObject<filePack>(rawData);
|
||||
@@ -618,16 +628,21 @@ namespace LPA
|
||||
string fullPath = $"{localReportPath}{item.fileName}";
|
||||
File.WriteAllText(fullPath, item.content);
|
||||
}
|
||||
Log.Instance.Info("Download template files aggiornati");
|
||||
utils.lgInfo("Download template files aggiornati");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Instance.Error($"Error: invalid file data received, deserialized to null ({rawData})");
|
||||
utils.lgError($"Error: invalid file data received, deserialized to null ({rawData})");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
utils.lgError("Error in deserialization during refreshLocaltemplate", exc);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Instance.Error("Error: no file data downloaded");
|
||||
utils.lgError("Error: no file data downloaded");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -653,6 +668,8 @@ namespace LPA
|
||||
rawData = callUrl(url2call);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
try
|
||||
{
|
||||
// deserializzo
|
||||
listQueue = JsonConvert.DeserializeObject<List<queueConf>>(rawData);
|
||||
@@ -663,29 +680,36 @@ namespace LPA
|
||||
{
|
||||
lbPrintQueue.Items.Add(item.name);
|
||||
}
|
||||
Log.Instance.Info("Effettuato update elenco printQueue");
|
||||
utils.lgInfo("Effettuato update elenco printQueue");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Instance.Error($"Error: invalid file data received, deserialized to null ({rawData})");
|
||||
utils.lgError($"Error: invalid file data received, deserialized to null ({rawData})");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
utils.lgError("Error in deserialization during refreshQueueAvail", exc);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Instance.Error("Error: no file data downloaded");
|
||||
utils.lgError("Error: no file data downloaded");
|
||||
}
|
||||
showPrinterList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiorna stato code
|
||||
/// </summary>
|
||||
private void refreshQueueStsatus()
|
||||
private void refreshQueueStatus()
|
||||
{
|
||||
// verifico ed aggiorno quantità coda
|
||||
int numTot = 0;
|
||||
string urlApiQueue = $"{serverBaseAddr}/api/PrintQueue";
|
||||
string rawData = callUrl(urlApiQueue);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
try
|
||||
{
|
||||
// deserializzo
|
||||
int.TryParse(rawData, out numTot);
|
||||
@@ -749,6 +773,11 @@ namespace LPA
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
utils.lgError("Error in deserialization during refreshQueueStatus", exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user