Exemplo n.º 1
0
        /// <summary>
        /// Method to use the current eyetracking configuration
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveChanges_MouseClick(object sender, MouseEventArgs e)
        {
            //  Gets the instance of the intermediate class
            IntermediateClass interClass = IntermediateClass.GetInstance();
            //  Plugin and reticle selection, if "None" has been selected, the string is null
            string selectedPlugin  = ((trackingPlugins.Text == "None") ? null : pluginsCurrentRoute + "\\" + trackingPlugins.Text);
            string selectedReticle = ((reticleSelected.Text == "None") ? null : reticlesCurrentRoute + "\\" + reticleSelected.Text);

            if (selectedPlugin != null)
            {
                try
                {
                    //  If a plugin was selected, then the intermediate class is initializated with the current configuration
                    interClass.InitializeClass(selectedPlugin,
                                               selectedReticle,
                                               controlMouse.Checked,
                                               Decimal.ToInt32(clickTimer.Value),
                                               saveData.Checked,
                                               dataSaveCurrentRoute,
                                               fileNameTextBox.Text);
                    MessageBox.Show("Configuración seleccionada con éxito");
                    this.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("No se ha seleccionado un plugin");
            }
        }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //  Combobox population
            InitializeComboBox(trackingPlugins, pluginsCurrentRoute, "*.dll");
            InitializeComboBox(reticleSelected, reticlesCurrentRoute, "*.png");

            reticleExample.SizeMode = PictureBoxSizeMode.StretchImage;
            reticleDimensions.Text  = "Ancho: 0px\nAlto: 0px";

            pluginsRoute.Text  = pluginsCurrentRoute;
            reticlesRoute.Text = reticlesCurrentRoute;
            saveFileRoute.Text = dataSaveCurrentRoute;

            IntermediateClass intermediate = IntermediateClass.GetInstance();
        }
Exemplo n.º 3
0
        public void ProcessData()
        {
            try
            {
                string[] _logfilePath          = ConfigurationManager.AppSettings["timeToLoadData"].Split(',');
                string[] _updateDMADataNow     = ConfigurationManager.AppSettings["UpdateDMADataNow"].Split(',');
                string[] _loadDataNow          = ConfigurationManager.AppSettings["LoadDataNow"].Split(',');
                string   _masterDatapathBasic  = ConfigurationManager.AppSettings["MasterDatapathBasic"];
                string   _masterDMAExcelSource = ConfigurationManager.AppSettings["MasterDMAExcelSource"];
                string   _masterDatapathDMA    = ConfigurationManager.AppSettings["MasterDatapathDMA"];

                string _defaultDate = "0";


                TimeSpan now = DateTime.Now.TimeOfDay;
                foreach (string item in _logfilePath)
                {
                    int h = Convert.ToInt32(item.Split('.')[0]);
                    int s = Convert.ToInt32(item.Split('.')[1]);

                    TimeSpan start = new TimeSpan(h, s, 0);
                    TimeSpan end   = new TimeSpan(h, s + 3, 0);

                    if ((now > start) && (now < end))
                    {
                        //Service processing the request in Market time
                        IntermediateClass obj = new IntermediateClass();
                        MessageContext.MessageLog(obj.ProcessRequest("BasicData,OI"));
                        MessageContext.MessageLog(obj.LoadMCData());
                    }



                    if (_loadDataNow.ToString().ToUpper() == "TRUE")
                    {
                        //Service processing the request in Market time
                        IntermediateClass obj = new IntermediateClass();
                        MessageContext.MessageLog(obj.ProcessRequest("BasicData,OI-Using Loaded now option."));
                        MessageContext.MessageLog(obj.LoadMCData());
                    }
                }

                //post market time service updating the Master data excel files
                TimeSpan startPost = new TimeSpan(17, 0, 0);
                TimeSpan endPost   = new TimeSpan(20, 0, 0);
                if ((now > startPost) && (now < endPost))
                {
                    IntermediateClass obj     = new IntermediateClass();
                    string            message = obj.RefreshData(_defaultDate);
                    if (message.Contains("Updated sucussfully"))
                    {
                        try
                        {
                            BasicDataLogic objList  = new BasicDataLogic();
                            Dma            objDma   = new Dma();
                            OBJtoXML       xmltoObj = new OBJtoXML();

                            List <CompanyDetails> basicData    = objList.UpdateDMAMasterSource(_masterDatapathBasic, _defaultDate);
                            List <KeyValue>       objLtpPrices = GeneratePrices(basicData);
                            List <Rank>           dMADataRank  = objDma.GetDmaData(_masterDMAExcelSource, objLtpPrices, "");
                            message = message + " DMA,";
                            xmltoObj.CreateXML(dMADataRank, _masterDatapathDMA, "DMAData", false);
                        }
                        catch (Exception ex)
                        {
                            ErrorContext.ErrorLog("Error in PostRefresh DMA Data" + ex.Message);
                        }
                    }
                    MessageContext.MessageLog(message);
                }
                if (_updateDMADataNow.ToString().ToUpper() == "TRUE")
                {
                    IntermediateClass obj = new IntermediateClass();
                    MessageContext.MessageLog(obj.RefreshData(_defaultDate));
                    MessageContext.MessageLog("DMA data updated using updateDMADataNow option.");
                }
            }
            catch (Exception ex)
            {
                EventLog.WriteEntry(ex.Message, EventLogEntryType.Error);
                ErrorContext.ErrorLog("Problem when Gettign the files   " + ex.Message.ToString());
            }
        }