public void initTest()
 {
     System.Diagnostics.Trace.WriteLine("INIZIO");
     app = LumenApplication.Instance;
     app.avvia();
     _impl.start();
 }
Exemplo n.º 2
0
        public void Init()
        {
            LumenApplication app = LumenApplication.Instance;

            using (new UnitOfWorkScope()) {
                _impl = new UtilitaSrvImpl();
                _impl.start();
            }
        }
Exemplo n.º 3
0
 public void initTest()
 {
     System.Diagnostics.Trace.WriteLine("INIZIO");
     app = LumenApplication.Instance;
     app.avvia();
     _impl.start();
     //aggancio l'ascoltatore
     _impl.InviaStatoMasterizzazione += new BurnerSrvImpl.StatoMasterizzazioneEventHandler(statoMasterizzazione);
 }
Exemplo n.º 4
0
        public void Init()
        {
            LumenApplication             app        = LumenApplication.Instance;
            IObservable <ScaricoFotoMsg> observable = app.bus.Observe <ScaricoFotoMsg>();

            observable.Subscribe(this);

            this._scaricatoreImpl = new ScaricatoreFotoSrvImpl();
            _scaricatoreImpl.start();

            // -------
            using (LumenEntities dbContext = new LumenEntities())
            {
                InfoFissa i = dbContext.InfosFisse.Single <InfoFissa>(f => f.id == "K");

                // Se hai fatto bene la configurazione, il fotografo artista deve sempre esistere
                _artista = dbContext.Fotografi.Single(f => f.id == Configurazione.ID_FOTOGRAFO_DEFAULT);
            }

            String doveSono = Assembly.GetExecutingAssembly().Location;

            string appPath  = Path.GetDirectoryName(doveSono);
            string cartella = Path.Combine(appPath, "images");
            string nomeSrc  = Directory.GetFiles(cartella, "barCode.jpg").ElementAt(0);

            FileInfo fiInfo = new FileInfo(nomeSrc);

            ParamScarica param = new ParamScarica();

            param.nomeFileSingolo      = nomeSrc;
            param.cartellaSorgente     = null;
            param.eliminaFilesSorgenti = false;

            param.flashCardConfig = new Config.FlashCardConfig(_artista);
            _scaricatoreImpl.scarica(param);

            while (!_puoiTogliereLaFlashCard)
            {
                Thread.Sleep(10000);
            }

            Console.Write("ok puoi togliere la flash card. Attendere elaborazione in corso ...");

            while (!_elaborazioneTerminata)
            {
                Thread.Sleep(10000);
            }

            Console.WriteLine("Ecco finito");


            this._barCodeimpl = new BarCodeSrvImpl();

            IRicercatoreSrv srv2 = app.creaServizio <IRicercatoreSrv>();
        }
Exemplo n.º 5
0
        public void initTest()
        {
            System.Diagnostics.Trace.WriteLine("INIZIO");
            app = LumenApplication.Instance;
            app.avvia();
            this._impl = (VenditoreSrvImpl)LumenApplication.Instance.getServizioAvviato <IVenditoreSrv>();

            IObservable <StampatoMsg> observable = app.bus.Observe <StampatoMsg>();

            ascoltami = observable.Subscribe(this);
        }
Exemplo n.º 6
0
        public void Init()
        {
            LumenApplication app = LumenApplication.Instance;

            using (new UnitOfWorkScope()) {
                _observable = app.bus.Observe <StampatoMsg>();
                _observable.Subscribe(this);

                _impl = new SpoolStampeSrvImpl();
                _impl.start();
            }
        }
Exemplo n.º 7
0
        public void Init()
        {
            LumenApplication app = LumenApplication.Instance;

            app.avvia();

            this._impl = new RicercatoreSrvImpl();

            IRicercatoreSrv srv2 = app.creaServizio <IRicercatoreSrv>();

            // -------
            using (LumenEntities dbContext = new LumenEntities()) {
            }
        }
Exemplo n.º 8
0
        public void initTest()
        {
            Console.WriteLine("INIZIO");
            LumenApplication app = LumenApplication.Instance;

            app.avvia();
            IObservable <MasterizzaMsg> observable = app.bus.Observe <MasterizzaMsg>();

            observable.Subscribe(this);

            _impl.start();

            Console.WriteLine("FINE");
        }
Exemplo n.º 9
0
        public void Init()
        {
            LumenApplication             app        = LumenApplication.Instance;
            IObservable <ScaricoFotoMsg> observable = app.bus.Observe <ScaricoFotoMsg>();

            observable.Subscribe(this);

            _impl = new ScaricatoreFotoSrvImpl();
            _impl.start();



            // -------
            using (LumenEntities dbContext = new LumenEntities()) {
                InfoFissa i = dbContext.InfosFisse.Single <InfoFissa>(f => f.id == "K");

                _mario = Utilita.ottieniFotografoMario(dbContext);

                // Se hai fatto bene la configurazione, il fotografo artista deve sempre esistere
                _artista = dbContext.Fotografi.Single(f => f.id == Configurazione.ID_FOTOGRAFO_DEFAULT);

                // cerco l'evento con la descrizione
                _ballo = (from e in dbContext.Eventi
                          where e.descrizione == "BALLO"
                          select e).FirstOrDefault();

                if (_ballo == null)
                {
                    _ballo = new Evento();

                    _ballo.descrizione = "BALLO";
                    _ballo.id          = Guid.NewGuid();
                    dbContext.Eventi.Add(_ballo);
                }

                _briscola = (from e in dbContext.Eventi
                             where e.descrizione == "BRISCOLA"
                             select e).FirstOrDefault();

                if (_briscola == null)
                {
                    _briscola             = new Evento();
                    _briscola.id          = Guid.NewGuid();
                    _briscola.descrizione = "BRISCOLA";
                    dbContext.Eventi.Add(_briscola);
                }

                dbContext.SaveChanges();
            }
        }
Exemplo n.º 10
0
        public void Init()
        {
            LumenApplication app = LumenApplication.Instance;

            app.avvia();

            IImpronteSrv srv2 = LumenApplication.Instance.getServizioAvviato <IImpronteSrv>();

            this._impl = (ImpronteZKTecoSrvImpl)srv2;

            Assert.IsTrue(srv2.statoRun == Lumen.Servizi.StatoRun.Running, "Lo scanner deve essere connesso");

            // -------
            using (LumenEntities dbContext = new LumenEntities()) {
            }
        }
Exemplo n.º 11
0
        public IServizio creaServizio(Type tipo)
        {
            // Istanzio
            LumenApplication app = LumenApplication.Instance;

            // calcolo il nome completo della interfaccia che mi fa da chiave per la mappa.
            string key = calcFullName(tipo);

            if (app.configurazione.nomiServizi.Keys.Contains(key) == false)
            {
                throw new NotSupportedException("servizio " + key + " non definito nella configurazione");
            }

            /** Puo essere separato da virgola */
            string [] pezzi        = app.configurazione.nomiServizi [key].Split(',');
            string    nomeImpl     = pezzi[0];
            string    assemblyName = (pezzi.Length > 1 ? pezzi[1] : null);

            Object oo;

            try {
                if (assemblyName != null)
                {
                    ObjectHandle oh = (ObjectHandle)Activator.CreateInstance(AppDomain.CurrentDomain, assemblyName, nomeImpl);
                    oo = oh.Unwrap();
                }
                else
                {
                    oo = Activator.CreateInstance(Type.GetType(nomeImpl));
                }
            } catch (Exception ee) {
                System.Console.Out.WriteLine("Impossibile creare impl del servizio " + nomeImpl);
                throw ee;
            }

            IServizio servizio = (IServizio)oo;

            // IServizio servizio = (IServizio)Activator.CreateInstance( assemblyName, nomeImpl );

            // Sottoscrivo questo servizio come asoltatore del bus di eventi
            LumenApplication.Instance.aggiungiAscoltatoreServizioBus(servizio);

            return(servizio);
        }
Exemplo n.º 12
0
        public void initTest()
        {
            System.Diagnostics.Trace.WriteLine("INIZIO");
            LumenApplication app = LumenApplication.Instance;

            app.avvia();

            ScaricatoreFotoImplTest scaricatore = new ScaricatoreFotoImplTest();

            scaricatore.Init();
            scaricatore.scaricaFileTest();

            giorni = Configurazione.infoFissa.numGiorniEliminaFoto;
            System.Diagnostics.Trace.WriteLine("GIORNI " + giorni);

            using (LumenEntities dbContext = new LumenEntities()) {
                _mario = Utilita.ottieniFotografoMario(dbContext);
            }
            _impl = new EliminaFotoVecchieSrvImpl();
            _impl.start();
        }