コード例 #1
0
ファイル: Controller.cs プロジェクト: LorenzoChiana/DSS19
        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);
            }
        }
コード例 #2
0
ファイル: Controller.cs プロジェクト: federicapecci/SSD19-1
        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);
            }
        }
コード例 #3
0
        // 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);
            }
        }