public string GetDescriptionForSelectedId(string id)
        {
            int numeralId = Convert.ToInt32(id);

            foreach (Fitting fitting in allFittings)
            {
                if (numeralId == fitting.id)
                {
                    selectedFitting    = fitting;
                    wasFittingSelected = true;
                    string resultString = "";
                    resultString += $"Fitting with ID ({fitting.id})\n";
                    resultString += $"Fitting comment ({fitting.comment})\n";
                    resultString += $"Booking ID ({fitting.booking.id})\n";
                    resultString += $"Booking Creation Date: {fitting.booking.creationDate.ToString()}\n";
                    resultString += $"Booking Issue Date: {fitting.booking.issueDate.ToString()}\n";
                    resultString += $"Booking Total Sum: {fitting.booking.bookingSum}\n";
                    resultString += $"Is Marked: {fitting.booking.isMarked.ToString()}\n";
                    resultString += $"Model Name: {fitting.booking.model.name}\n";
                    resultString += $"Fabric Name: {fitting.booking.fabric.name}\n";
                    resultString += $"Cutter Name: fitting.{fitting.booking.cutter.fullName}\n";
                    resultString += $"Cutter Number of Orders: {fitting.booking.cutter.numberOfOrders}\n";
                    return(resultString);
                }
            }
            return($"ERROR: Cannot load Fitting with ID ({id})");
        }
        public async Task <IActionResult> CreateFitting([FromBody] Fitting fitting)
        {
            try
            {
                if (fitting != null)
                {
                    var response = await SchedulerHandler.InsertFitting(fitting);

                    if (response != null)
                    {
                        return(Ok(response));
                    }
                    else
                    {
                        return(StatusCode(505, new ErrorResponse()
                        {
                            Message = "Error occurred while saving fitting to database, please try again."
                        }));
                    }
                }
                return(StatusCode(408, new ErrorResponse()
                {
                    Message = "Bad Request - Fitting data is null"
                }));
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.ToString());
                return(StatusCode(505, ex.Message));
            }
        }
Beispiel #3
0
 public void UpdateFitting(string fittingName, Fitting fitting)
 {
     if (_fittings.ContainsKey(fittingName))
     {
         _fittings[fittingName] = fitting;
     }
 }
Beispiel #4
0
        public void LoadFittings(string searchPath)
        {
            var fittings = new List <Fitting>();

            if (Directory.Exists(searchPath))
            {
                var fileNames = Directory.GetFiles(searchPath);

                foreach (var fileName in fileNames)
                {
                    if (fileName.EndsWith(".xml") & !fileName.EndsWith("Blanko.xml"))
                    {
                        Debug.WriteLine("Deserialize " + fileName);
                        try
                        {
                            var fitting = Fitting.FromFile(fileName);
                            fitting.FilePath = fileName;
                            fittings.Add(fitting);
                        }
                        catch (Exception)
                        {
                            //Überspringen TODO: dirty
                        }
                    }
                }

                if (fittings.Count > 0)
                {
                    Fittings = fittings;
                }
            }
        }
Beispiel #5
0
        public static async Task <Fitting> InsertFitting(Fitting fitting)
        {
            using (var conn = Business.Database.Connection)
            {
                fitting.createdOn = DateTime.UtcNow;
                fitting.fittingId = Guid.NewGuid();
                var returnedFitting = await conn.QueryAsync <Fitting>("FittingInsert", new
                {
                    fitting.fittingId,
                    fitting.userId,
                    fitting.orderId,
                    fitting.isVirtual,
                    fitting.timeRequested,
                    fitting.dateRequested,
                    fitting.timeZone,
                    fitting.createdOn
                }, commandType : CommandType.StoredProcedure);

                if (returnedFitting.AsList().Count() > 0)
                {
                    return(returnedFitting.AsList()[0]);
                }
                return(null);
            }
        }
Beispiel #6
0
 public static dynamic GetTSObject(Fitting dynObject)
 {
     if (dynObject is null)
     {
         return(null);
     }
     return(dynObject.teklaObject);
 }
Beispiel #7
0
        public Fitting GetFitting(string fittingName)
        {
            Fitting dummyFitting = new Fitting();

            dummyFitting.Name = "Dummy";

            return(dummyFitting);
        }
        public void CurveFit(int length)
        {
            if (length < 2)
            {
                throw new Exception("Occured curvefit's data length low error in Calibrator.CurveFit");
            }

            double[] rawX = new double[length];
            double[] rawY = new double[length];

            for (int i = 0; i < length; i++)
            {
                rawX[i] = Points[i].PV;
                rawY[i] = Points[i].SV;
            }

            DiffA = 0;
            DiffB = 0;
            DiffC = 0;

            try
            {
                switch (length)
                {
                case 2:
                    RawA = rawY[0] - rawX[0];
                    RawB = (rawY[1] - rawY[0]) / (rawX[1] - rawX[0]);
                    RawC = 0;
                    break;

                default:
                    if ((IsDoubleArrayAllZero(rawX) == false) &&
                        (IsDoubleArrayAllZero(rawY) == false))
                    {
                        double[] raw = Fitting.LsFit(rawX, rawY, 2);
                        RawA = raw[0];
                        RawB = raw[1];
                        RawC = raw[2];
                    }
                    else
                    {
                        RawA = 0;
                        RawB = 1;
                        RawC = 0;
                    }
                    break;
                }

                Active = true;
            }
            catch (Exception e)
            {
                Clear();
                Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
                throw new Exception("Occured calculation error in Calibrator.CurveFit");
            }
        }
        public void TestEllipseCoeficients()
        {
            Mat __coords = Mat.Ones(1, 2, MatType.CV_64FC1);

            __coords.Set <double>(0, 0, 2);
            __coords.Set <double>(0, 1, 3);

            Mat __output = Fitting.GenerateEllipseCoeff(__coords);
        }
        public void TestDataFitting1()
        {
            Mat __xVector = Mat.Ones(5, 2, MatType.CV_64FC1);
            Mat __yVector = Mat.Zeros(5, 1, MatType.CV_64FC1);

            Cv2.Randn(__xVector, 1, 1);

            Mat __output = Fitting.DataFitting(__xVector, __yVector, Fitting.FittingCategrory.Polynominal, 1);
        }
 public void SetFitting(Fitting fitting)
 {
     Application.Current.Dispatcher.Invoke(
                                   () =>
                                   {
                                       _fitting = fitting;
                                       BtnSaveFitting.Visibility = _fitting != null ? Visibility.Visible : Visibility.Hidden ;
                                   });
 }
        public void CK10_ApplyFitting()
        {
            // Current Workplane. Reminder how the user had the model before you did stuff.
            TransformationPlane CurrentPlane = Model.GetWorkPlaneHandler().GetCurrentTransformationPlane();

            Picker Picker     = new Picker();
            Beam   PickedBeam = null;

            try
            {
                PickedBeam = (Beam)Picker.PickObject(Picker.PickObjectEnum.PICK_ONE_PART);
            }
            catch { PickedBeam = null; }
            if (PickedBeam != null)
            {
                // Change the workplane to the coordinate system of the Beam
                var psk = new TransformationPlane(PickedBeam.GetCoordinateSystem());
                Model.GetWorkPlaneHandler().SetCurrentTransformationPlane(psk);

                // Applyfitting
                Fitting BeamFitting = new Fitting();
                BeamFitting.Father = PickedBeam;
                Plane FittingPlane = new Plane();
                FittingPlane.Origin = new T3D.Point(500, 0, 0);
                FittingPlane.AxisX  = new T3D.Vector(0, 0, 500);
                FittingPlane.AxisY  = new T3D.Vector(0, -500, 0);
                BeamFitting.Plane   = FittingPlane;
                BeamFitting.Insert();

                // Apply Line Cut
                CutPlane BeamLineCut = new CutPlane();
                BeamLineCut.Father = PickedBeam;
                Plane BeamCutPlane = new Plane();
                BeamCutPlane.Origin = new T3D.Point(200, 0, 0);
                BeamCutPlane.AxisX  = new T3D.Vector(0, 0, 500);
                // Changing the positive vs. negative value here determines which direction
                // the line cut will take away material where as fitting looks at which end
                // of beam it is closest to figure out how to cut.
                BeamCutPlane.AxisX = new T3D.Vector(0, -500, 0);
                BeamLineCut.Plane  = BeamCutPlane;
                BeamLineCut.Insert();

                // SetWorkplane back to what user had before
                Model.GetWorkPlaneHandler().SetCurrentTransformationPlane(CurrentPlane);

                // Show the plate in the model and the workplane change
                Model.CommitChanges();

                // Draw Positive Z axis.
                GraphicsDrawer Drawer = new GraphicsDrawer();
                var            red    = new Color(1, 0, 0);
                Drawer.DrawLineSegment(new T3D.Point(0, 0, 0), new T3D.Point(0, 0, 500), red);
            }
            Model.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane());
        }
        private void CuttingBeam(Part beam, Point inputPt, Vector axisX, Vector axisY)
        {
            Fitting cuttingBeam = new Fitting();

            cuttingBeam.Plane        = new Plane();
            cuttingBeam.Plane.Origin = inputPt;
            cuttingBeam.Plane.AxisX  = axisX;
            cuttingBeam.Plane.AxisY  = axisY;
            cuttingBeam.Father       = beam;
            cuttingBeam.Insert();
        }
Beispiel #14
0
        public List <Fitting> GetAllFittings()
        {
            List <Fitting> fittings = new List <Fitting>();

            Fitting dummyFitting = new Fitting();

            dummyFitting.Name = "Dummy";
            fittings.Add(dummyFitting);

            return(fittings);
        }
Beispiel #15
0
 public FittingsVM(Fitting el)
 {
     if (el == null)
     {
         IsHaveValues = false;
         return;
     }
     Id           = el.Id;
     Type         = el.Type;
     Price        = el.Price;
     IsHaveValues = true;
 }
        public void TestPolynominalCoefficients()
        {
            Mat __coords = Mat.Ones(1, 2, MatType.CV_64FC1);

            __coords.Set <double>(0, 0, 2);
            __coords.Set <double>(0, 1, 3);

            Mat __output = Fitting.GeneratePolynomialCoeff(__coords, 1);

            __output = Fitting.GeneratePolynomialCoeff(__coords, 2);
            __output = Fitting.GeneratePolynomialCoeff(__coords, 3);
        }
Beispiel #17
0
        private void btnApplyFitting_Click(object sender, EventArgs e)
        {
            // Current workplane. Remember how the user had the model before you changed things.
            TransformationPlane currentPlane = currentModel.GetWorkPlaneHandler().GetCurrentTransformationPlane();

            TSMUI.Picker myPicker    = new TSMUI.Picker();
            Beam         currentBeam = null;

            try
            {
                currentBeam = myPicker.PickObject(TSMUI.Picker.PickObjectEnum.PICK_ONE_PART) as Beam;
            }
            catch
            {
                currentBeam = null;
            }

            if (currentBeam != null)
            {
                // Change the workplane to the coordinate system of the beam.
                currentModel.GetWorkPlaneHandler().SetCurrentTransformationPlane(new TransformationPlane(currentBeam.GetCoordinateSystem()));

                // Apply fitting
                Fitting beamFitting = new Fitting();
                beamFitting.Father = currentBeam;
                Plane fittingPlane = new Plane();
                fittingPlane.Origin = new T3D.Point(500, 0, 0);
                fittingPlane.AxisX  = new T3D.Vector(0, 0, 500);
                fittingPlane.AxisY  = new T3D.Vector(0, 500, 0);
                beamFitting.Plane   = fittingPlane;
                beamFitting.Insert();

                // Apply cut line
                CutPlane beamLineCut = new CutPlane();
                beamLineCut.Father = currentBeam;
                Plane beamCutPlane = new Plane();
                beamCutPlane.Origin = new T3D.Point(2000, 0, 0);
                beamCutPlane.AxisX  = new T3D.Vector(0, 0, 500);
                // Changing positive vs. negative value here determines which direction
                // the line cut will take away material where as fittin glooks at which end
                // of the beam it is closest to to figure out how to cut
                beamCutPlane.AxisY = new T3D.Vector(0, -500, 0);
                beamLineCut.Plane  = beamCutPlane;
                beamLineCut.Insert();

                // Setworkplane back to what user had before
                currentModel.GetWorkPlaneHandler().SetCurrentTransformationPlane(currentPlane);

                // Show the fitting in the model but the user will never see the workplane change
                currentModel.CommitChanges();
            }
        }
        public async Task SaveFittingAsync(Fitting fitting)
        {
            await EnsureTokenIsValid()
                .ConfigureAwait(false);

            var fittingJson = JsonConvert.SerializeObject(
                                                          fitting,
                                                          new JsonSerializerSettings
                                                          {
                                                              ContractResolver = new CamelCasePropertyNamesContractResolver()
                                                          });
            await Crest.Settings.DocumentLoader.AuthenticatedPostRequest(Character.Fittings.Href, BearerToken, fittingJson, DataType.Json);
        }
Beispiel #19
0
        public void Post([FromBody] Fitting fitting)
        {
            //var combatLogEntry1 = new CombatLogEntry();
            //combatLogEntry1.Name = "C1";

            //var combatLogEntry2 = new CombatLogEntry();
            //combatLogEntry2.Name = "C2";

            //fitting.CombatLogEntries.Add(combatLogEntry1);
            //fitting.CombatLogEntries.Add(combatLogEntry2);

            _db.CreateFitting(fitting);
        }
Beispiel #20
0
        /// <summary>Create A Fitting</summary>
        /// <remarks>Requires SSO Authentication, using "write_fittings" scope</remarks>
        /// <param name="CharacterID">(Int32) Character ID</param>
        /// <param name="Fitting">(Fitting) Fitting</param>
        /// <returns>EsiRequest</returns>
        public EsiRequest Create(int CharacterID, Fitting Fitting)
        {
            var Path = $"/characters/{CharacterID.ToString()}/fittings/";
            var Data = new
            {
                name         = Fitting.Name,
                description  = Fitting.Description,
                ship_type_id = Fitting.ShipTypeID,
                items        = Fitting.Items.Select(item => new { type_id = item.TypeID, quantity = item.Quantity, flag = item.Flag }).ToArray()
            };

            return(new EsiRequest(EasyObject, Path, EsiWebMethod.AuthPost, Data));
        }
Beispiel #21
0
        public async Task CanMakeGetRequests()
        {
            Fitting fitting = new Fitting
            {
                ApiBasePath   = "https://xkcd.com",
                RequestSuffix = "/info.0.json",
                ContentType   = "application/json",
                Method        = "GET"
            };

            FittingResponse <object> response = await fitting.SendRequest <object>();

            Assert.IsNotNull(response);
            Assert.IsTrue(response.Status.Health == FittingResponseStatusHealth.Good);
        }
Beispiel #22
0
    } // property Recipes


    public FittingBase(long itemID)
    {
        ID = itemID;
        if (ID > 0)
        {
            Fitting itemRecord = ItemGateway.FittingGetByID(itemID);
            Name = itemRecord.displayName;
            Description = itemRecord.displayDescription;
        } // if (ID > 0)
        else
        {
            Name = "n/a";
            Description = "n/a";
        }
    } // constructor
Beispiel #23
0
        public async Task CanMakePostRequests()
        {
            Fitting fitting = new Fitting
            {
                ApiBasePath   = "https://localhost:5001",
                RequestSuffix = "/api/offers",
                ContentType   = "application/json",
                Method        = "POST"
            };

            FittingResponse <object> response = await fitting.SendRequest <object>();

            Assert.IsNotNull(response);
            Assert.IsTrue(response.Status.Health == FittingResponseStatusHealth.Good);
        }
Beispiel #24
0
    } // method ItemGetByID

    // This method is used by the FittingBase constructor
    public static Fitting FittingGetByID(long objectID)
    {
        string cacheKey = "Fitting_" + objectID;
        Fitting returnObject = HttpContext.Current.Cache[cacheKey] as Fitting;

        if (returnObject == null)
        {
            using (RepopdataEntities myEntities = new RepopdataEntities())
            {
                returnObject = (from item in myEntities.Fittings
                                where item.fittingID == objectID
                                select item).FirstOrDefault();
                if (returnObject == null) { return null; }
                AppCaching.AddToCache(cacheKey, returnObject);
            } // using
        } // if (returnObject == null)
        return returnObject;
    } // method FittingGetByID
Beispiel #25
0
        public static Fitting SetGeometry(this Fitting fittingObj, Point location, List <Point> connectionLocations)
        {
            if (fittingObj == null || location == null || connectionLocations == null)
            {
                return(null);
            }

            if (connectionLocations.Count < 2)
            {
                Engine.Reflection.Compute.RecordError("A fitting requires at least 2 physical connections, e.g. an elbow fitting has 2, please input at least two Points in connectionLocations.");
                return(null);
            }
            Fitting clone = fittingObj.ShallowClone();

            clone.Location            = location;
            clone.ConnectionsLocation = connectionLocations;
            return(clone);
        }
Beispiel #26
0
        public void FullDBHelper()
        {
            IDBHelper db = new DBHelper_InMemory.DBHelper();

            db.Init();

            Fitting firstFitting     = new Fitting();
            string  firstFittingName = "First Fitting Name";

            firstFitting.Name = firstFittingName;

            db.CreateFitting(firstFitting);

            var getFirstFitting = db.GetFitting(firstFittingName);

            Assert.AreEqual(getFirstFitting.Name.ToUpperInvariant(), firstFittingName.ToUpperInvariant());

            var allFittings = db.GetAllFittings();

            getFirstFitting = allFittings[0];
            Assert.AreEqual(getFirstFitting.Name.ToUpperInvariant(), firstFittingName.ToUpperInvariant());

            CombatLogEntry firstCombatLogEntry     = new CombatLogEntry();
            string         firstCombatLogEntryName = "First Combat Log Entry Name";

            firstCombatLogEntry.Name = firstCombatLogEntryName;

            db.CreateCombatLogEntry(firstFittingName, firstCombatLogEntry);

            var getCombatLogEntry = db.GetCombatLogEntry(firstCombatLogEntryName);

            Assert.AreEqual(getCombatLogEntry.Name.ToUpperInvariant(), firstCombatLogEntryName.ToUpperInvariant());

            CombatLogEntry secondCombatLogEntry     = new CombatLogEntry();
            string         secondCombatLogEntryName = "Second Combat Log Entry Name";

            secondCombatLogEntry.Name = secondCombatLogEntryName;

            db.CreateCombatLogEntry(firstFittingName, secondCombatLogEntry);

            getCombatLogEntry = db.GetCombatLogEntry(secondCombatLogEntryName);
            Assert.AreEqual(getCombatLogEntry.Name.ToUpperInvariant(), secondCombatLogEntryName.ToUpperInvariant());
        }
Beispiel #27
0
        public static PriceItem GetLastPriceItem(IUnitOfWork uow, Fitting fitting, Provider provider)
        {
            PriceItem pricePriceItemAlias = null;
            Price     pricePriceAlias     = null;

            var query = uow.Session.QueryOver <PriceItem>(() => pricePriceItemAlias)
                        .JoinAlias(c => c.Price, () => pricePriceAlias)
                        .Where(() => pricePriceItemAlias.Fitting.Id == fitting.Id);

            if (provider != null)
            {
                query.Where(() => pricePriceAlias.Provider.Id == provider.Id);
            }

            return(query
                   .OrderBy(() => pricePriceAlias.Date).Desc
                   .Take(1)
                   .SingleOrDefault());
        }
 public bool TryFoundFitting()
 {
     if (!String.IsNullOrWhiteSpace(Code))
     {
         var foundList = Repository.FittingRepository.GetFittings(WC.UoW, Code, Diameter);
         if (foundList.Count == 1)
         {
             Status  = RowStatus.FoundModel;
             Fitting = foundList.First();
             return(true);
         }
         else if (foundList.Count > 1)
         {
             Status       = RowStatus.MultiFound;
             IsMultiFound = true;
             return(true);
         }
     }
     return(false);
 }
Beispiel #29
0
        public void FittingBeamByFace()
        {
            Beam           beam      = PickBeam();
            GeometricPlane geomPlane = PickFace();

            Fitting fitting = new Fitting();

            fitting.Father = beam;
            CoordinateSystem beamCS = beam.GetCoordinateSystem();

            ReperShow(beamCS);
            Line lineAlongBeamAxisX = new Line(beamCS.Origin, beamCS.AxisX);

            //do u need Z asis
            //T3D.Vector axisZ = beamCS.
            T3D.Point intersectionPoint = Intersection.LineToPlane(lineAlongBeamAxisX, geomPlane);
            PointShow(intersectionPoint, "intersectionPoint");

            T3D.Point randomPoint = new T3D.Point(intersectionPoint + new T3D.Point(500, 500, 500));
            PointShow(randomPoint, "randomPoint");
            randomPoint = Projection.PointToPlane(randomPoint, geomPlane);
            PointShow(randomPoint, "Projected randomPoint");
            T3D.Vector       x        = new T3D.Vector(randomPoint - intersectionPoint);
            T3D.Vector       y        = geomPlane.Normal.Cross(x);
            CoordinateSystem itersect = new CoordinateSystem(intersectionPoint, x, y);

            ReperShow(itersect);

            Plane plane = new Plane();

            plane.Origin = intersectionPoint;
            plane.AxisX  = x;
            plane.AxisY  = y;
            x.Normalize(500);
            y.Normalize(500);
            fitting.Plane = plane;
            fitting.Insert();

            Model.CommitChanges();
        }
        private void TryApplyFits(Part beam, List <Tuple <Tuple <Point, Point, Point>, Plane> > fitPlanes)
        {
            if (null == fitPlanes)
            {
                return;
            }

            var centerLine = GetBeamCenterLineSegmentExpanded(beam, 10.0);

            if (null == centerLine)
            {
                return;
            }

            // check collision
            foreach (var fitPlaneDef in fitPlanes)
            {
                //var pps = fitPlaneDef.Item1;
                var plane = fitPlaneDef.Item2;
                //var geomPlane = new GeometricPlane(pps.Item1, new Vector(pps.Item3));
                var geomPlane    = new GeometricPlane(plane.Origin, plane.AxisX, plane.AxisY);
                var intersection = Intersection.LineSegmentToPlane(centerLine, geomPlane);
                if (null == intersection)
                {
                    Tracer._trace($"Does not intersect with {beam.Profile.ProfileString}");
                    continue;
                }
                var operativePart = fitPlaneDef.Item2;

                var fitPlane = new Fitting();
                fitPlane.Father = beam;
                fitPlane.Plane  = operativePart;
                if (!fitPlane.Insert())
                {
                    Tracer._trace("Insert failed!");
                }
                Tracer._trace($"Fit solid: {beam.Name}.");
            }
        }
Beispiel #31
0
    internal TurretComponent[] GetComponentsMatching(Slot slot, Type filter = null)
    {
        TurretComponent[] components = new TurretComponent[parts.Length + utilities.Length + weapons.Length];
        Array.Copy(parts, components, parts.Length);
        Array.Copy(utilities, 0, components, parts.Length, utilities.Length);
        Array.Copy(weapons, 0, components, parts.Length + utilities.Length, weapons.Length);

        ArrayList filteredComponents = new ArrayList();

        for (int i = 0; i < components.Length; i++)
        {
            TurretComponent component = components[i];
            Fitting         fitting   = component.fitting;
            if (!fitting.size.Fits(slot.size))
            {
                // Make sure the fitting is smaller or equal than the slot
                continue;
            }
            if (!fitting.armament.Fits(slot.armament))
            {
                // Make sure tha armament type can fit in the slot
                continue;
            }
            if (filter != null && component.GetComponent(filter) == null)
            {
                // Make sure the object is of the corect type
                continue;
            }
            // else
            filteredComponents.Add(component);
        }

        TurretComponent[] objects = new TurretComponent[filteredComponents.Count];
        Array.Copy(filteredComponents.ToArray(), objects, filteredComponents.Count);

        return(objects);
    }
Beispiel #32
0
        public static List <Line> Geometry(this Fitting fitting)
        {
            if (fitting == null)
            {
                return(null);
            }

            List <Line> result = new List <Line>();

            if (fitting.ConnectionsLocation.Count == 2)
            {
                result.Add(BH.Engine.Geometry.Create.Line(fitting.ConnectionsLocation[0], fitting.ConnectionsLocation[1]));
            }

            else
            {
                foreach (Point point in fitting.ConnectionsLocation)
                {
                    result.Add(BH.Engine.Geometry.Create.Line(fitting.Location, point));
                }
            }

            return(result);
        }
Beispiel #33
0
 /// <summary>
 ///   Fits the underlying distribution to a given set of observations.
 /// </summary>
 /// 
 /// <param name="observations">The array of observations to fit the model against. The array
 ///   elements can be either of type double (for univariate data) or
 ///   type double[] (for multivariate data).</param>
 /// <param name="weights">The weight vector containing the weight for each of the samples.</param>
 /// <param name="options">Optional arguments which may be used during fitting, such
 ///   as regularization constants and additional parameters.</param>
 /// 
 public override void Fit(double[][] observations, double[] weights, Fitting.IFittingOptions options)
 {
     throw new NotSupportedException();
 }
        /// <summary>
        ///   Fits the underlying distribution to a given set of observations.
        /// </summary>
        /// 
        /// <param name="observations">The array of observations to fit the model against. The array
        ///   elements can be either of type double (for univariate data) or
        ///   type double[] (for multivariate data).</param>
        /// <param name="weights">The weight vector containing the weight for each of the samples.</param>
        /// <param name="options">Optional arguments which may be used during fitting, such
        ///   as regularization constants and additional parameters.</param>
        ///   
        /// <remarks>
        ///   Although both double[] and double[][] arrays are supported,
        ///   providing a double[] for a multivariate distribution or a
        ///   double[][] for a univariate distribution may have a negative
        ///   impact in performance.
        /// </remarks>
        /// 
        public override void Fit(double[][] observations, double[] weights, Fitting.IFittingOptions options)
        {
            HiddenMarkovOptions normalOptions = options as HiddenMarkovOptions;
            if (options != null && normalOptions == null)
                throw new ArgumentException("The specified options' type is invalid.", "options");

            Fit(observations, weights, normalOptions);
        }
        private static bool CreateFittings(Beam targetBeam, double customGap)
        {
            bool Result = false;

            Fitting fitBeam = new Fitting();
            fitBeam.Plane = new Plane();
            fitBeam.Plane.Origin = new Point(customGap, -160, -500);
            fitBeam.Plane.AxisX = new Vector(0.0, 500.0, 0.0);
            fitBeam.Plane.AxisY = new Vector(0.0, 0.0, 1200.0);
            fitBeam.Father = targetBeam;

            if (fitBeam.Insert())
                Result = true;

            return Result;
        }
 /// <summary>
 ///   Fits the underlying distribution to a given set of observations.
 /// </summary>
 /// 
 /// <param name="observations">The array of observations to fit the model against. The array
 ///   elements can be either of type double (for univariate data) or
 ///   type double[] (for multivariate data).</param>
 /// <param name="weights">The weight vector containing the weight for each of the samples.</param>
 /// <param name="options">Optional arguments which may be used during fitting, such
 ///   as regularization constants and additional parameters.</param>
 ///   
 /// <remarks>
 ///   Although both double[] and double[][] arrays are supported,
 ///   providing a double[] for a multivariate distribution or a
 ///   double[][] for a univariate distribution may have a negative
 ///   impact in performance.
 /// </remarks>
 /// 
 public override void Fit(double[] observations, double[] weights, Fitting.IFittingOptions options)
 {
     if (weights != null)
         throw new NotSupportedException();
     initialize((double[])observations.Clone(), null);
 }
 public int Compare(Fitting x, Fitting y)
 {
     return String.Compare(x.Name, y.Name, true, CultureInfo.CurrentCulture);
 }
        /// <summary>
        ///   Fits the underlying distribution to a given set of observations.
        /// </summary>
        /// 
        /// <param name="observations">The array of observations to fit the model against. The array
        /// elements can be either of type double (for univariate data) or
        /// type double[] (for multivariate data).</param>
        /// <param name="weights">The weight vector containing the weight for each of the samples.</param>
        /// <param name="options">Optional arguments which may be used during fitting, such
        /// as regularization constants and additional parameters.</param>
        /// 
        /// <remarks>
        ///   Although both double[] and double[][] arrays are supported,
        ///   providing a double[] for a multivariate distribution or a
        ///   double[][] for a univariate distribution may have a negative
        ///   impact in performance.
        /// </remarks>
        /// 
        public override void Fit(double[] observations, double[] weights, Fitting.IFittingOptions options)
        {
            if (immutable)
                throw new InvalidOperationException("This object can not be modified.");

            if (options != null)
                throw new ArgumentException("No options may be specified.");

            a = observations.Min();
            b = observations.Max();
        }
        /// <summary>
        ///   Fits the underlying distribution to a given set of observations.
        /// </summary>
        /// 
        /// <param name="observations">The array of observations to fit the model against. The array
        ///   elements can be either of type double (for univariate data) or
        ///   type double[] (for multivariate data).</param>
        /// <param name="weights">The weight vector containing the weight for each of the samples.</param>
        /// <param name="options">Optional arguments which may be used during fitting, such
        ///   as regularization constants and additional parameters.</param>
        ///   
        /// <remarks>
        ///   Although both double[] and double[][] arrays are supported,
        ///   providing a double[] for a multivariate distribution or a
        ///   double[][] for a univariate distribution may have a negative
        ///   impact in performance.
        /// </remarks>
        /// 
        public override void Fit(double[] observations, double[] weights, Fitting.IFittingOptions options)
        {
            if (weights != null)
                throw new ArgumentException("This distribution does not support weighted samples.");

            if (options != null)
                throw new ArgumentException("This method does not accept fitting options.");

            initialize((double[])observations.Clone(), null);
        }
        /// <summary>
        ///   Fits the underlying distribution to a given set of observations.
        /// </summary>
        /// 
        /// <param name="observations">The array of observations to fit the model against. The array
        /// elements can be either of type double (for univariate data) or
        /// type double[] (for multivariate data).</param>
        /// <param name="weights">The weight vector containing the weight for each of the samples.</param>
        /// <param name="options">Optional arguments which may be used during fitting, such
        /// as regularization constants and additional parameters.</param>
        /// 
        /// <remarks>
        ///   Although both double[] and double[][] arrays are supported,
        ///   providing a double[] for a multivariate distribution or a
        ///   double[][] for a univariate distribution may have a negative
        ///   impact in performance.
        /// </remarks>
        /// 
        public override void Fit(double[] observations, double[] weights, Fitting.IFittingOptions options)
        {
            if (options != null)
                throw new ArgumentException("No options may be specified.");

            if (weights != null)
                throw new ArgumentException("This distribution does not support weighted samples.");

            a = (int)observations.Min();
            b = (int)observations.Max();
        }
        /// <summary>
        ///   Fits the underlying distribution to a given set of observations.
        /// </summary>
        /// 
        /// <param name="observations">The array of observations to fit the model against. The array
        /// elements can be either of type double (for univariate data) or
        /// type double[] (for multivariate data).</param>
        /// <param name="weights">The weight vector containing the weight for each of the samples.</param>
        /// <param name="options">Optional arguments which may be used during fitting, such
        /// as regularization constants and additional parameters.</param>
        /// 
        /// <remarks>
        ///   Although both double[] and double[][] arrays are supported,
        ///   providing a double[] for a multivariate distribution or a
        ///   double[][] for a univariate distribution may have a negative
        ///   impact in performance.
        /// </remarks>
        /// 
        public override void Fit(double[] observations, double[] weights, Fitting.IFittingOptions options)
        {
            if (options != null)
                throw new ArgumentException("No options may be specified.");

            a = (int)observations.Min();
            b = (int)observations.Max();
        }