public void CorrectLevel()
    {
        bool correct = false;

        if (SceneManager.GetActiveScene().name == "Level1")
        {
            string[] organs = { "lungs" };
            correct = Correction.CorrectionLevelA(Tilemap, arteriesPointsListInt, organs);
        }
        else if (SceneManager.GetActiveScene().name == "Level2")
        {
            string[] organs = { "lungs" };
            correct = Correction.CorrectionLevelB(Tilemap, arteriesPointsListInt, veinsPointsListInt, organs);
        }
        else if (SceneManager.GetActiveScene().name == "Level3")
        {
            string[] organs = { "lungs" };
            correct = Correction.CorrectionLevelC(Tilemap, arteriesPointsListInt, veinsPointsListInt, organs);
        }
        else if (SceneManager.GetActiveScene().name == "Level4")
        {
            string[] organs = { "lungs", "muscle" };
            correct = Correction.CorrectionLevelC(Tilemap, arteriesPointsListInt, veinsPointsListInt, organs);
        }

        if (correct)
        {
            gameObject.GetComponent <GameManager>().LevelPassed();
        }
        else
        {
            gameObject.GetComponent <GameManager>().LevelIncorrect();
        }
    }
Ejemplo n.º 2
0
 //Entite vers DTO
 public CorrectionDTO(Correction p_corrections)
 {
     this.Correction_id = p_corrections.CorrectionID;
     this.Solution_id   = p_corrections.SolutionID;
     this.Etudiant_id   = p_corrections.EtudiantID;
     this.Finaliser     = p_corrections.Finaliser;
 }
Ejemplo n.º 3
0
        // GET: Corrections/Create
        public ActionResult Create(int?ReceiptID, int?VoucherID)
        {
            Correction cor = null;

            if (ReceiptID.HasValue)
            {
                cor = new Correction {
                    RecieptID = (int)ReceiptID
                };
                var FaultyRec = db.Form4.Find(ReceiptID);
                ViewBag.Heading = String.Format("Receipt of {0} created on {1:dd-MMM-yyyy} against subledger: {2}", FaultyRec.Citizen?.Name + FaultyRec.RecvdFrom, FaultyRec.PayDate, FaultyRec.Ledger.Ledger1 + " >> " + FaultyRec.SubLedger.Ledger);
            }

            if (cor == null)
            {
                cor = (VoucherID.HasValue) ? new Correction {
                    VoucherID = (int)VoucherID
                } : null;
                var FaultyRec = db.Vouchers.Find(VoucherID);
                ViewBag.Heading = String.Format("Voucher of {0} created on {1:dd-MMM-yyyy} against subledger: {2}", FaultyRec.PassedBy, FaultyRec.PayDate, FaultyRec.Ledger.Ledger1 + " >> " + FaultyRec.SubLedger.Ledger);
            }
            if (cor == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }



            return(View(cor));
        }
Ejemplo n.º 4
0
        // Distribuer au etudiants une solutions selon le id du travail passé en parametre
        private void DistributionSolution(int p_fichierID)
        {
            Travail         travail                 = this.m_depotTravail.ChercherTravailParID(p_fichierID);
            List <Solution> listeSolution           = this.m_depotSolution.ChercherSolutionParTravailID(p_fichierID);
            List <Etudiant> listeEtudiant           = this.m_depotInscription.ListerEtudiantsParCoursID(travail.CoursID);
            int             nombreSolutionDistribue = 0;

            Queue <Solution> fileSolutions = GenererQueueAleatoire(listeSolution);

            while (nombreSolutionDistribue < travail.NombresDeRevues)
            {
                foreach (Etudiant etudiant in listeEtudiant)
                {
                    Correction correction = this.m_depotCorrections.CreerCorrection(etudiant.EtudiantID, fileSolutions.Peek().SolutionID);
                    this.m_depotCorrections.AjouterCorrection(correction);

                    fileSolutions.Peek().NombreDeDistrubtion++;

                    if (fileSolutions.Peek().NombreDeDistrubtion == travail.NombresDeRevues)
                    {
                        Solution solution = fileSolutions.Dequeue();
                        fileSolutions.Enqueue(solution);
                    }
                }
                nombreSolutionDistribue++;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Method TryCreateQRCode makes attempt conversion data
        /// </summary>
        /// <param name="QRdata">array will contain conversion data</param>
        /// <returns>Returns true if attempt was success and false if not</returns>
        private bool TryCreateQRCode(out byte[] QRdata)
        {
            QRdata = default;

            byte[][] dataBlocks;
            byte[][] correctionBlocks;

            if (serviceData == null)
            {
                serviceData = new ServiceData(CodingType, CorrectionLevel);
            }
            serviceData.CodingType      = CodingType;
            serviceData.CorrectionLevel = CorrectionLevel;

            if (coder.TryEncoding(out byte[] binaryData))
            {
                if (serviceData.TryGetData(binaryData.Length, coder.DataLength, out byte[] binaryServiceData))
                {
                    binaryData       = DataCombiner.FillingData(serviceData.Capacity, binaryServiceData, binaryData);
                    dataBlocks       = DataDivider.DivideByBlocks(binaryData, CorrectionLevel, serviceData.Version);
                    correctionBlocks = Correction.GetCorrectionBlocks(dataBlocks, CorrectionLevel, serviceData.Version);
                    QRdata           = DataCombiner.MergeBlocks(dataBlocks, correctionBlocks);
                    return(true);
                }
                ErrorHandler?.Invoke("Превышен лимит данных! \r\nУменьшите кол-во данных или используйте другой уровень коррекции");
                return(false);
            }
Ejemplo n.º 6
0
        public void OpenPicture(string file)
        {
            if (!File.Exists(file))
            {
                MessageService.ShowError(null, string.Format("Cannot open file : File {0} doesn't exist", file));
                return;
            }

            Original = new BitmapImage(new Uri(file));

            VerticalProjection = new Projection(Original)
            {
                Type = ProjectionType.Vertical
            };
            VerticalProjection.Compute();

            HorizontalProjection = new Projection(Original)
            {
                Type = ProjectionType.Horizontal
            };
            HorizontalProjection.Compute();

            CharacterIsolation   = new CharacterIsolation(Original);
            CharacterRecognition = new CharacterRecognition(Original);

            Correction = new Correction(Original, new WordTree(new HammingDistance(false),
                                                               new HammingDistance('?', false), new FrequencyResolver()));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Map points
        /// </summary>
        /// <param name="laserLocations"></param>
        /// <param name="image"></param>
        /// <returns></returns>
        public ScanLine MapPoints(List <PointF> laserLocations, Bitmap image, bool useCorrection)
        {
            Point3DList points = Mapper.MapPoints(laserLocations, image, DefaultColor);
            ScanLine    ret    = new ScanLine(Id, points.Count);

            ret.DisplayAsLine = true;
            if (useCorrection)
            {
                Matrix4d m     = Correction.GetMatrix();
                int      count = points.Count;
                for (int i = 0; i < count; i++)
                {
                    Point3D  p = points[i];
                    Vector3d v = Vector3d.Transform(p.Position, m);
                    Vector3d n = Vector3d.Transform(p.Normal, m);
                    n.Normalize();
                    ret.Add(new Point3D(v, n, p.Color));
                }
            }
            else
            {
                ret.Add(points);
            }

            return(ret);
        }
Ejemplo n.º 8
0
 internal Block(double TrackPosition, double Offset)
 {
     this.StartingTrackPosition = TrackPosition;
     Correction      = null;
     this.stopMarker = new List <StationStop>();
     this.Signals    = new List <Semaphore>();
     this.YOffset    = Offset;
 }
Ejemplo n.º 9
0
        public ActionResult DeleteConfirmed(int id)
        {
            Correction correction = db.Corrections.Find(id);

            db.Corrections.Remove(correction);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public void Disable_send_as_is()
        {
            correction = Open(new Correction(address.Id));

            Assert.AreEqual(1, correction.Lines.Count);
            Assert.IsTrue(correction.CanSend.Value);
            correction.Lines[0].Order.Send = false;
            Assert.IsFalse(correction.CanSend.Value);
        }
Ejemplo n.º 11
0
        private void OnCorrectText(object parameter)
        {
            if (!CanCorrectText(parameter))
            {
                return;
            }

            Correction.Compute();
        }
        private string[] Apply(string[] tags, Correction[] corrections)
        {
            if (corrections.GroupBy(x => x.Tag).Any(x => x.ToArray().Select(y => y.Type).Distinct().Count() > 1))
                throw new InvalidOperationException(string.Format("Conflict corrections {0}.", corrections[0].ProblemUrl));

            var removeTags = corrections.Where(x => x.Type == CorrectionType.DeleteTag).Select(x => x.Tag).ToArray();
            var addTags = corrections.Where(x => x.Type == CorrectionType.AddTag).Select(x => x.Tag).ToArray();

            return tags.Except(removeTags).Concat(addTags).ToArray();
        }
        public void Correction_report()
        {
            correction = Open(new Correction());
            Assert.IsTrue(correction.IsUpdate);
            Assert.IsFalse(correction.IsOrderSend);
            var report = correction.Save().ToArray().OfType <SaveFileResult>().First();
            var text   = File.ReadAllText(report.Dialog.FileName, Encoding.Default);

            Assert.That(text, Does.Contain(String.Format("адрес доставки {0}", address.Name)));
        }
Ejemplo n.º 14
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            string correctionID = dgvCorrections.CurrentRow.Cells["ID"].Value.ToString();

            Correction.DeleteCorrectionFromDB(correctionID);

            MessageBox.Show("Correction " + correctionID + " has been successfully removed from the database!", "INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Information);

            ResetCorrectionsDataGrid((CorrectionType)cbxTypesOfCorrections.SelectedIndex);
        }
        public void AjouterCorrection(Correction p_correction)
        {
            if (p_correction is null)
            {
                throw new ArgumentException(nameof(p_correction));
            }

            this.m_appDbContext.Correction.Add(new CorrectionDTO(p_correction));
            this.m_appDbContext.SaveChanges();
        }
Ejemplo n.º 16
0
        public ActionResult Edit([Bind(Include = "CorrectionID,RecieptID,VoucherID,Amount,Remark")] Correction correction)
        {
            if (ModelState.IsValid)
            {
                db.Entry(correction).State = EntityState.Modified;
                correction.CorrectionDate  = DateTime.Today;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(correction));
        }
Ejemplo n.º 17
0
        public ActionResult Create([Bind(Include = "CorrectionID,RecieptID,VoucherID,Amount,Remark")] Correction correction)
        {
            if (ModelState.IsValid)
            {
                correction.CorrectionDate = DateTime.Today;
                db.Corrections.Add(correction);
                db.SaveChanges();
                return(RedirectToAction("Index", new { ReceiptID = correction.RecieptID, VoucherID = correction.VoucherID }));
            }

            return(View(correction));
        }
Ejemplo n.º 18
0
        // GET: Corrections/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Correction correction = db.Corrections.Find(id);

            if (correction == null)
            {
                return(HttpNotFound());
            }
            return(View(correction));
        }
Ejemplo n.º 19
0
        public void ResetCorrectionsDataGrid(CorrectionType typeOfCorrection)
        {
            dgvCorrections.DataSource = Correction.GetCorrections(typeOfCorrection);

            dgvCorrections.Columns["ServiceTicketID"].Visible = false;
            dgvCorrections.Columns["Cost"].DisplayIndex       = 7;
            dgvCorrections.Columns["ID"].Width          = 30;
            dgvCorrections.Columns["ID"].DisplayIndex   = 0;
            dgvCorrections.Columns["OrderID"].Width     = 50;
            dgvCorrections.Columns["ProductCode"].Width = 80;
            dgvCorrections.Columns["Cost"].Width        = 70;
            dgvCorrections.Columns["Duration"].Width    = 70;
            dgvCorrections.Columns["StartDateTimeOfOperation"].HeaderText = "StartDate";
        }
Ejemplo n.º 20
0
        private void populateCorrectionUserControl()
        {
            this.UserControlPanel.Controls.Clear();
            F25090FieldSummaryData.CorrectionDataDataTable ds = new F25090FieldSummaryData.CorrectionDataDataTable();
            Correction corection = new Correction();

            corection.CorrectionDataSet = this.FieldData.CorrectionData;
            this.UserControlPanel.Controls.Add(corection);
            this.F25090Panel.Controls.Clear();
            this.F25090Panel.Controls.Add(this.UserControlPanel);
            this.F25090Panel.Controls.Add(this.BottomPanel);
            this.F25090PictureBox.SendToBack();
            corection.Location = new System.Drawing.Point(0, 0);
        }
        public void CorrectionTest()
        {
            // Correction : A
            Correction corr = new Correction();

            Assert.AreEqual("", corr.Choix);
            //
            corr = new Correction("Correction");
            Assert.AreEqual("", corr.Choix);
            //
            corr = new Correction("Correction :");
            Assert.AreEqual("", corr.Choix);
            //
            corr = new Correction("Correction : A");
            Assert.AreEqual("A", corr.Choix);
        }
        public Document Create(DocumentType documentType)
        {
            Document document = null;

            switch (documentType)
            {
            case DocumentType.Bill: document = new Bill(); break;

            case DocumentType.Invoice: document = new Invoice(); break;

            case DocumentType.Correction: document = new Correction(); break;

            default: new NotSupportedException(); break;
            }

            return(document);
        }
Ejemplo n.º 23
0
        public void Set(IntVector2 position, Correction correction)
        {
            // Duplicate definition should be removed from the list.
            int duplicateIndex = state.grids.FindIndex(g => g.p == position);

            if (duplicateIndex >= 0)
            {
                state.grids.RemoveAt(duplicateIndex);
            }

            // add new user-defiend grid to state.
            state.grids.Add(new CorrectionGrid {
                p = position,
                c = correction,
            });

            Corrected    = false;
            FieldUpdated = false;
        }
Ejemplo n.º 24
0
        private void OnDistanceChanged()
        {
            if (UseHammingDistance)
            {
                Correction = new Correction(Original, new WordTree(new HammingDistance(false),
                                                                   new HammingDistance('?', false), new FrequencyResolver()));
            }
            if (UseLevenstheinDistance)
            {
                Correction = new Correction(Original, new WordTree(new LevenshteinDistance(),
                                                                   new LevenshteinDistance(), new FrequencyResolver()));
            }

            if (!string.IsNullOrEmpty(DictionaryFilePath))
            {
                LoadDictionary(DictionaryFilePath);
            }

            CorrectTextCommand.RaiseCanExecuteChanged();
        }
        public static void Test()
        {
            DocumentType documentType = DocumentType.Invoice;

            Document document = null;

            switch (documentType)
            {
            case DocumentType.Bill: document = new Bill(); break;

            case DocumentType.Invoice: document = new Invoice(); break;

            case DocumentType.Correction: document = new Correction(); break;

            default: new NotSupportedException(); break;
            }


            Console.WriteLine(document.Number);
        }
Ejemplo n.º 26
0
        public void testCorrectionFactorInterpolation()
        {
            Correction        correction1 = new Correction("filename.txt", 1, Double.NaN);
            Correction        correction2 = new Correction("filename.txt", 2, Double.NaN);
            Correction        correction3 = new Correction("filename.txt", 3, 4D);
            Correction        correction4 = new Correction("filename.txt", 4, Double.NaN);
            Correction        correction5 = new Correction("filename.txt", 5, 6D);
            Correction        correction6 = new Correction("filename.txt", 6, Double.NaN);
            List <Correction> correctionFactorTestList = new List <Correction> {
                correction1, correction2, correction3, correction4, correction5, correction6
            };
            List <Correction> interpolated = Correction.CorrectionFactorInterpolation(correctionFactorTestList);

            foreach (Correction corr in interpolated)
            {
                Assert.AreEqual(Double.IsNaN(corr.correction), false);//checking to see that all values are defined.
            }

            Assert.AreEqual(interpolated.First().correction, 4D);                                // checking to see if the first undefined values were given the first defined value
            Assert.AreEqual(interpolated.Last().correction, 6D);                                 //checing to see if undefined values at the end of the list are given last defined value
            Assert.AreEqual(interpolated.Where(s => s.scan_number == 4).First().correction, 5D); //checking to see that undefined values in the middle of the list are given average
        }
Ejemplo n.º 27
0
        public void correction_factors_into_chargestates()
        {
            string    filename   = "filename.txt";
            string    scan_range = "1-3";
            Component c          = new Component();

            c.input_file = new InputFile("fake.txt", Purpose.Identification);
            c.scan_range = scan_range;
            Correction        correction1 = new Correction(filename, 1, Double.NaN);
            Correction        correction2 = new Correction(filename, 2, Double.NaN);
            Correction        correction3 = new Correction(filename, 3, 4D);
            List <Correction> corrections = Correction.CorrectionFactorInterpolation(new List <Correction> {
                correction1, correction2, correction3
            });
            string charge_count  = "1";
            string intensity     = "1001.1";
            string mz_centroid   = "123.2";
            string reported_mass = "125.0";

            c.add_charge_state(new List <string> {
                charge_count, intensity, mz_centroid, reported_mass
            }, Correction.GetCorrectionFactor(filename, scan_range, corrections));
        }
Ejemplo n.º 28
0
        private void btnLogServiceTicket_Click(object sender, EventArgs e)
        {
            Correction.days = 1;

            _ValidationMethods.Reset();

            if (cbxClientID.Text == null || cbxClientID.Text == "")
            {
                _ValidationMethods.AddToInvalidFields("Client ID");
            }

            if (cbxOrderID.Text == null || cbxOrderID.Text == "")
            {
                _ValidationMethods.AddToInvalidFields("Order ID");
            }

            if (cbxProductCode.Text == null || cbxProductCode.Text == "")
            {
                _ValidationMethods.AddToInvalidFields("Product Code");
            }

            ServiceTicket serviceTicket = new ServiceTicket(DataHandler.lastCallLogID, txtDescription.Text);

            if (_ValidationMethods.isValid)
            {
                serviceTicket.SaveServiceTicketToDB();

                Correction correction = new Correction(0, int.Parse(cbxOrderID.Text), cbxProductCode.Text, null, DateTime.MinValue, null, null, null);

                correction.SaveCorrectionToDB();

                frmManageCorrections form = new frmManageCorrections();
                form.Show();

                this.Hide();
            }
        }
Ejemplo n.º 29
0
        private void btnFinalise_Click(object sender, EventArgs e)
        {
            decimal price;

            if (txtCost.Text != null && txtCost.Text != "")
            {
                price = decimal.Parse(txtCost.Text);

                int startHours   = int.Parse(txtStartTimeHours.Text);
                int startMinutes = int.Parse(txtStartTimeMinutes.Text);
                int endHours     = int.Parse(txtEndTimeHours.Text);
                int endMinutes   = int.Parse(txtEndTimeMinutes.Text);

                DateTime dateOfCorrection = new DateTime(int.Parse(date.Substring(0, 4)), int.Parse(date.Substring(5, 2)), int.Parse(date.Substring(8, 2)));

                TimeSpan ts = new TimeSpan(startHours, startMinutes, 0);
                dateOfCorrection = dateOfCorrection.Date + ts;

                Correction correction = new Correction(correctionID, orderID, productCode, cbxTechnicianID.Text, dateOfCorrection, 0, price, null);


                if (correction.CalculateDuration(startHours, startMinutes, endHours, endMinutes))
                {
                    correction.FinaliseCorrection();

                    frmManageCorrections form = new frmManageCorrections();
                    form.Show();

                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Please enter a price!", "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 30
0
 public static void AddCorrection(Correction correction)
 {
     correctedWords.Add(correction);
 }