public async Task <Bitmap> readCustomerOrdersChart(string dbPath) { Trace.WriteLine("getting the orders chart ... "); pythonScriptsPath = System.IO.Path.GetFullPath(pythonScriptsPath); try { Bitmap bmp = await pyRunner.getImageAsync( pythonScriptsPath, "chartOrders.py", pythonScriptsPath, dbPath, strRandCustomers); return(bmp); } catch (Exception e) { Trace.WriteLine(e.ToString()); return(null); } }
public async Task <Bitmap> readCustomerOrdersChart(string dbOrdiniPath, string pyScript) { Trace.WriteLine("Getting the orders chart..."); //pythonScriptsPath = System.IO.Path.GetFullPath(pythonScriptsPath); pythonScriptsPath = @"C:\Users\federica.pecci2\Documents\GitHub\SSD19-1\DSS19\DSS19\python_scripts"; try { Bitmap bmp = await pyRunner.getImageAsync( pythonScriptsPath, pyScript, // chartOrders.py o nuovo script pythonScriptsPath, dbOrdiniPath, strCustomer); //strCustomers riga dei customer restituita dal db, select dei customer random return(bmp); } catch (Exception exception) { Trace.WriteLine("[CONTROLLER] errore: " + exception.Message); return(null); } }
// Lettura e previsione di una serie di ordini public async Task <Bitmap> BitmapOfCustomersOrdersChart(string dbPath, string pythonFile) { Trace.WriteLine("Getting the orders chart ..."); //pythonScriptsPath = System.IO.Path.GetFullPath(pythonScriptsPath); //trasforma i path relativi in path assoluti Bitmap bmp; try { // Funzione asincrona, prende un'immagine. Infatti quello che restituisce è una bitmap. // L'esecuzione di questo sarà infatti una Bitmap bmp = await pyRunnes.getImageAsync( this.pythonScriptsPath, pythonFile, this.pythonScriptsPath, dbPath, this.strCustomers); return(bmp); } catch (Exception e) { Trace.WriteLine($"[BitmapOfCustomersOrdersChart]: {e.ToString()}"); return(null); } }