コード例 #1
0
 void MyFunc(InputClass input, out OutputClass output)
 {
     output   = new OutputClass();
     output.n = input.n;
     System.Threading.Thread.Sleep(10000);
     //return true;
 }
コード例 #2
0
ファイル: Classes.cs プロジェクト: JeremiahZhang/AKA
    // Main begins program execution.
    public static void Main()
    {
        // Instance of OutputClass
        OutputClass outCl = new OutputClass("This is printed by the output class.");

        // Call Output class' method
        outCl.printString();
    }
コード例 #3
0
    // Main begins program execution
    public static void Main()
    {
        OutputClass outC1 = new OutputClass("This is printed by the output class.");

        // Call output class' method
        outC1.printString();
        OutputClass.staticPrinter();
    }
コード例 #4
0
    // Main begins program execution.
    public static void Main()
    {
        // Instance of OutputClass
        OutputClass outCl = new OutputClass("This is printed by the output class.");

        // Call Output class' method
        outCl.printString();
    }
コード例 #5
0
        private void CalculateOutboardPoints(OutputClass _ocOut, SuspensionCoordinatesMaster _scmOut)
        {
            // TO CALCULATE THE NEW POSITION OF J i.e., TO CALCULATE J'
            // Vectors used -> J'Jo, J'D & J'C
            double XJ1 = 0, YJ1 = 0, ZJ1 = 0;

            QuadraticEquationSolver.Solver(l_J1x, l_J1y, l_J1z, l_JO1x, l_JO1y, l_JO1z, _ocOut.DamperLength, l_D1x, l_D1y, l_D1z, l_C1x, l_C1y, l_C1z, l_JO1x, l_JO1y, l_JO1z, l_D1x, l_D1y, l_D1z, l_C1x, l_C1y, l_C1z, l_JO1y, true, out XJ1, out YJ1, out ZJ1);

            _ocOut.scmOP.J1x = XJ1;
            _ocOut.scmOP.J1y = YJ1;
            _ocOut.scmOP.J1z = ZJ1;

            // TO CALCULATE THE NEW POSITION OF E i.e., TO CALCULATE E'
            // Vectors used -> E'J', E'C & E'D
            double XE1 = 0, YE1 = 0, ZE1 = 0;

            QuadraticEquationSolver.Solver(l_E1x, l_E1y, l_E1z, l_J1x, l_J1y, l_J1z, 0, l_C1x, l_C1y, l_C1z, l_D1x, l_D1y, l_D1z, _ocOut.scmOP.J1x, _ocOut.scmOP.J1y, _ocOut.scmOP.J1z, l_C1x, l_C1y, l_C1z, l_D1x, l_D1y, l_D1z, _ocOut.scmOP.J1y, true, out XE1, out YE1, out ZE1);

            _ocOut.scmOP.E1x = XE1;
            _ocOut.scmOP.E1y = YE1;
            _ocOut.scmOP.E1z = ZE1;

            CalculateFinaMotionRatio(_ocOut, _scmOut);

            // TO CALCULATE THE NEW POSITION OF M i.e., TO CALCULATE M'
            // Vectors used -> M'E', M'J' & M'N
            double XM1 = 0, YM1 = 0, ZM1 = 0;

            QuadraticEquationSolver.Solver(l_M1x, l_M1y, l_M1z, l_E1x, l_E1y, l_E1z, 0, l_J1x, l_J1y, l_J1z, l_N1x, l_N1y, l_N1z, _ocOut.scmOP.E1x, _ocOut.scmOP.E1y, _ocOut.scmOP.E1z, _ocOut.scmOP.J1x, _ocOut.scmOP.J1y, _ocOut.scmOP.J1z, l_N1x, l_N1y, l_N1z, l_JO1y, true, out XM1, out YM1, out ZM1);

            _ocOut.scmOP.M1x = XM1;
            _ocOut.scmOP.M1y = YM1;
            _ocOut.scmOP.M1z = ZM1;

            _ocOut.scmOP.N1x = l_N1x;
            _ocOut.scmOP.N1y = l_N1y;
            _ocOut.scmOP.N1z = l_N1z;

            // TO CALCULATE THE NEW POSITION OF K i.e., TO CALCULATE K'
            // Vectors used -> K'M', K'J' & K'E'
            double XK1 = 0, YK1 = 0, ZK1 = 0;

            QuadraticEquationSolver.Solver(l_K1x, l_K1y, l_K1z, l_M1x, l_M1y, l_M1z, 0, l_J1x, l_J1y, l_J1z, l_E1x, l_E1y, l_E1z, _ocOut.scmOP.M1x, _ocOut.scmOP.M1y, _ocOut.scmOP.M1z, _ocOut.scmOP.J1x, _ocOut.scmOP.J1y, _ocOut.scmOP.J1z, _ocOut.scmOP.E1x, _ocOut.scmOP.E1y, _ocOut.scmOP.E1z, _ocOut.scmOP.J1y, true, out XK1, out YK1, out ZK1);

            _ocOut.scmOP.K1x = XK1;
            _ocOut.scmOP.K1y = YK1;
            _ocOut.scmOP.K1z = ZK1;

            // TO CALCULATE THE NEW POSITION OF P i.e., TO CALCULATE P'
            // Vectors used -> P'O', P'Q & P'D
            double XP1 = 0, YP1 = 0, ZP1 = 0;

            QuadraticEquationSolver.Solver(l_P1x, l_P1y, l_P1z, l_E1x, l_E1y, l_E1z, 0, l_Q1x, l_Q1y, l_Q1z, l_J1x, l_J1y, l_J1z, _ocOut.scmOP.E1x, _ocOut.scmOP.E1y, _ocOut.scmOP.E1z, l_Q1x, l_Q1y, l_Q1z, _ocOut.scmOP.J1x, _ocOut.scmOP.J1y, _ocOut.scmOP.J1z, _ocOut.scmOP.J1y, true, out XP1, out YP1, out ZP1);

            _ocOut.scmOP.P1x = XP1;
            _ocOut.scmOP.P1y = YP1;
            _ocOut.scmOP.P1z = ZP1;
        }
コード例 #6
0
        /// <summary>
        /// Method to assign the Suspension Forces to the Batch Run Results
        /// </summary>
        /// <param name="_ocResults"></param>
        public void AssignSuspensionForces(OutputClass _ocResults)
        {
            LowerFront.Add(_ocResults.LowerFront);
            LowerFront_x.Add(_ocResults.LowerFront_x);
            LowerFront_y.Add(_ocResults.LowerFront_y);
            LowerFront_z.Add(_ocResults.LowerFront_z);


            LowerRear.Add(_ocResults.LowerRear);
            LowerRear_x.Add(_ocResults.LowerRear_x);
            LowerRear_y.Add(_ocResults.LowerRear_y);
            LowerRear_z.Add(_ocResults.LowerRear_z);


            UpperFront.Add(_ocResults.UpperFront);
            UpperFront_x.Add(_ocResults.UpperFront_x);
            UpperFront_y.Add(_ocResults.UpperFront_y);
            UpperFront_z.Add(_ocResults.UpperFront_z);


            UpperRear.Add(_ocResults.UpperRear);
            UpperRear_x.Add(_ocResults.UpperRear_x);
            UpperRear_y.Add(_ocResults.UpperRear_y);
            UpperRear_z.Add(_ocResults.UpperRear_z);


            PushRod.Add(_ocResults.PushRod);
            PushRod_x.Add(_ocResults.PushRod_x);
            PushRod_y.Add(_ocResults.PushRod_y);
            PushRod_z.Add(_ocResults.PushRod_z);


            ToeLink.Add(_ocResults.ToeLink);
            ToeLink_x.Add(_ocResults.ToeLink_x);
            ToeLink_y.Add(_ocResults.ToeLink_y);
            ToeLink_z.Add(_ocResults.ToeLink_z);


            DamperForce.Add(_ocResults.DamperForce);
            DamperForce_x.Add(_ocResults.DamperForce_x);
            DamperForce_y.Add(_ocResults.DamperForce_y);
            DamperForce_z.Add(_ocResults.DamperForce_z);


            ARBDroopLink.Add(_ocResults.ARBDroopLink);
            ARBDroopLink_x.Add(_ocResults.ARBDroopLink_x);
            ARBDroopLink_y.Add(_ocResults.ARBDroopLink_y);
            ARBDroopLink_z.Add(_ocResults.ARBDroopLink_z);


            UBJ_x.Add(_ocResults.UBJ_x);
            UBJ_y.Add(_ocResults.UBJ_y);
            UBJ_z.Add(_ocResults.UBJ_z);

            LBJ_x.Add(_ocResults.LBJ_x);
            LBJ_y.Add(_ocResults.LBJ_y);
            LBJ_z.Add(_ocResults.LBJ_z);
        }
コード例 #7
0
        /// <summary>
        /// Method to assign the Steering Column Forces to the Batch Run Results
        /// </summary>
        /// <param name="_ocResults"></param>
        public void AssignBearingCapForces_SteeringColumn(OutputClass _ocResults)
        {
            SColumnInboard1_x.Add(_ocResults.SColumnInboard1_x);
            SColumnInboard1_y.Add(_ocResults.SColumnInboard1_y);
            SColumnInboard1_z.Add(_ocResults.SColumnInboard1_z);

            SColumnInboard2_x.Add(_ocResults.SColumnInboard2_x);
            SColumnInboard2_y.Add(_ocResults.SColumnInboard2_y);
            SColumnInboard2_z.Add(_ocResults.SColumnInboard2_z);
        }
コード例 #8
0
        /// <summary>
        /// Method to only assign the color table of the <see cref="CAD.viewportLayout1"/>'s <see cref="Legend"/>
        /// </summary>
        private void ReConditionLegend()
        {
            OutputClass tempOC = new OutputClass();

            GetDataLegendDataSource(ParentCAD.LegendDataTable);
            tempOC.MaxForce = MaxValue;
            tempOC.MinForce = MinValue;
            ParentCAD.AssignLegendColourTable();
            GridControlConditioning_SetDataSource();
        }
コード例 #9
0
        /// <summary>
        /// Method to assign the ARB Bearing CapForces to the Batch Run Results
        /// </summary>
        /// <param name="_ocResults"></param>
        public void AssignBearingCapForces_ARB(OutputClass _ocResults)
        {
            ARBInboard1_x.Add(_ocResults.ARBInboard1_x);
            ARBInboard1_y.Add(_ocResults.ARBInboard1_y);
            ARBInboard1_z.Add(_ocResults.ARBInboard1_z);

            ARBInboard2_x.Add(_ocResults.ARBInboard2_x);
            ARBInboard2_y.Add(_ocResults.ARBInboard2_y);
            ARBInboard2_z.Add(_ocResults.ARBInboard2_z);
        }
コード例 #10
0
        internal void SetOutputClass(OutputClass _ocFL, OutputClass _ocFR, OutputClass _ocRL, OutputClass _ocRR)
        {
            OC_FL = _ocFL;

            OC_FR = _ocFR;

            OC_RL = _ocRL;

            OC_RR = _ocRR;
        }
コード例 #11
0
        /// <summary>
        /// Medhot to Recreate the Entire Legend
        /// </summary>
        private void ReDoEntireLegend()
        {
            OutputClass tempOC = new OutputClass();

            GetDataLegendDataSource(ParentCAD.LegendDataTable);
            tempOC.MaxForce = MaxValue;
            tempOC.MinForce = MinValue;
            ParentCAD.PostProcessing(this, tempOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
            GridControlConditioning_SetDataSource();
        }
コード例 #12
0
        /// <summary>
        /// Method to assign the Rack Bearing Cap Forces Forces to the Batch Run Results
        /// </summary>
        /// <param name="_ocResultsLeft"></param>
        public void AssignBearingCapForces_Rack(OutputClass _ocResultsLeft)
        {
            RackInboard1_x.Add(_ocResultsLeft.RackInboard1_x);
            RackInboard1_y.Add(_ocResultsLeft.RackInboard1_y);
            RackInboard1_z.Add(_ocResultsLeft.RackInboard1_z);

            RackInboard2_x.Add(_ocResultsLeft.RackInboard2_x);
            RackInboard2_y.Add(_ocResultsLeft.RackInboard2_y);
            RackInboard2_z.Add(_ocResultsLeft.RackInboard2_z);
        }
コード例 #13
0
        private void CalculateFinaMotionRatio(OutputClass _ocMR, SuspensionCoordinatesMaster _scmMR)
        {
            //Final Motion Ratio for McPherson Strut
            double J2JO_Perp, J2JO, alpha;

            J2JO_Perp          = Math.Abs(_ocMR.scmOP.J1x - l_JO1x);
            J2JO               = Math.Sqrt(Math.Pow((_ocMR.scmOP.J1x - l_JO1x), 2) + Math.Pow((_ocMR.scmOP.J1y - l_JO1y), 2));
            alpha              = Math.Asin(J2JO_Perp / J2JO);
            _ocMR.FinalMR      = Math.Acos(alpha);
            _ocMR.Final_ARB_MR = (_scmMR.O1I / _scmMR.P1Q) * (Math.Cos(alpha));
        }
コード例 #14
0
    // Main begins program execution.
    public static void xMain()
    {
        // Instance of OutputClass
        OutputClass outCl = new OutputClass("This is printed by the output class.");

        // Call Output class' method
        outCl.printString();

        // keep screen from going away
        // when run from VS.NET
        Console.ReadLine();
    }
コード例 #15
0
        /// <summary>
        /// Called when [save changes button click]. Save the changes made on
        /// the book information.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">
        /// The <see cref="EventArgs" /> instance containing the event data.
        /// </param>
        private void OnSaveChangesButton_Click(object sender, EventArgs e)
        {
            var fileOutput = new OutputClass();

            var validate = new ValidationClass();

            var msgBox = new MyMessageBoxClass();


            msgBox.NameOfMethod = MethodBase.GetCurrentMethod().Name;

            var coll = new global::BookList.Collections.BookDataCollection();

            if (coll.GetItemsCount() < 1)
            {
                return;
            }
            if (string.IsNullOrEmpty(txtTitle.Text.Trim()))
            {
                return;
            }

            if (BookDataProperties.BookSeries)
            {
                if (!validate.ValidateBookSeriesIsFormatted(txtBookInfo.Text))
                {
                    return;
                }
                if (!fileOutput.WriteBookTitleSeriesVolumeNamesToAuthorsFile(BookListPathsProperties
                                                                             .PathToCurrentAuthorsFile))
                {
                    msgBox.Msg = "Failed to complete save. Check over data and try again.";

                    msgBox.ShowErrorMessageBox();

                    return;
                }
            }

            if (!validate.ValidateBookNotSeriesIsFormatted(txtBookInfo.Text))
            {
                return;
            }

            if (!fileOutput.WriteAuthorsTitlesToFile(BookListPathsProperties.PathToCurrentAuthorsFile))
            {
                msgBox.Msg = "Failed to complete save. Check over data and try again.";
                msgBox.ShowErrorMessageBox();
                return;
            }

            ControlsStateAfterSuccessfulSave();
        }
コード例 #16
0
        /// <summary>
        ///     Adds the new author file name to authors list.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <exception cref="NotImplementedException" />
        private void AddNewAuthorFileNameToAuthorsList(string fileName)
        {
            _msgBox.NameOfMethod = MethodBase.GetCurrentMethod().Name;

            var clsOutput = new OutputClass();

            if (clsOutput.WriteArthurFileNamesToListFile(fileName))
            {
                _msgBox.Msg = "The authors name has been added to the authors list.";
                _msgBox.ShowInformationMessageBox();
                return;
            }

            _msgBox.Msg = "Encountered error while adding author name to list. Operation failed.";
            _msgBox.ShowErrorMessageBox();
        }
コード例 #17
0
        public static void ExampleClass()
        {
            // Instance of OutputClass
            var outCl = new OutputClass("This is printed by the output class.");
            var outC2 = new OutputClass(5);
            var outC3 = new OutputClass();


            // Call Output class' method
            outCl.printString();
            outC2.printString();
            outC3.printString();

            // Call static field that previously inicializated by static constructor
            AliasForNamespace.Console.WriteLine(OutputClass._count);

            // AliasForNamespace.GC.Collect(); // Why GC not work because link on object exist because object in method scope
        }
コード例 #18
0
        /// <summary>
        /// Public Inititalizer method which Performs all the Init activites required for a fully functioning <see cref="LegendEditor"/> Form
        /// </summary>
        /// <param name="_MasterOC">Base <see cref="OutputClass"/></param>
        /// <param name="_ParentCAD"></param>
        public void InitializeLegendEditor(OutputClass _MasterOC, CAD _ParentCAD)
        {
            ///<summary>Performing the Post Processing Activies of the Legend based on whether the Max and Min Value are 0. If they are 0 then it means the User is calling the Legend Editor for the very first time and hence the <see cref="BaseOC"/> should be passed</summary>
            if (MaxValue == 0 && MinValue == 0)
            {
                BaseOC = _MasterOC;
                _ParentCAD.PostProcessing(this, BaseOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
            }

            else
            {
                OutputClass tempOC = new OutputClass();
                tempOC.MaxForce = MaxValue;
                tempOC.MinForce = MinValue;
                _ParentCAD.PostProcessing(this, tempOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
            }

            ///<summary>Method to assign the Parent <see cref="CAD"/> object</summary>
            GetParentCADControl(_ParentCAD);

            ///<summary>Method to get the <see cref="LegendDataTable"/> property of this class</summary>
            GetDataLegendDataSource(_ParentCAD.LegendDataTable);

            ///<summary>Method to condition the <see cref="gridControl1"/> of this Form</summary>
            GridControlConditioning(_ParentCAD.LegendDataTable);

            ///<summary>Method to initialize the <see cref="CellValueChangedEventArgs"/> </summary>
            InitializeGridControlEvents();

            ///<remarks>
            ///It is best if the below lines of code are inside THIS Class and not the <see cref="VehicleGUI"/> class's <see cref="VehicleGUI.OutputDrawer(CAD, int, int, bool, bool)"/> method because this way, when the
            ///user wants to see the Forces of a different Motion Percentage, the options chosen by the user through the <see cref="LegendEditor"/> will be retained.
            /// </remarks>
            ///<summary>Painting the Bars according to Force Range in between which they lie. <see cref="LegendEditor.UserNoForceWishboneColour"/> value passed as <see cref="Color.White"/></summary>
            ParentCAD.PaintBarForce(UserNoForceWishboneColour, DisplayWishboneForces);

            ///<summary>Painting the Arrows according to Force Range in between which they lie</summary>
            ///<remarks>Since by default we have <see cref="ForceArrowStyle.Both"/> I can pass any random values for Length and Colour below</remarks>
            ParentCAD.ConditionArrowForce(UserForceArrowStyle, ArrowNoForceCylLength, ArrowNoForceColor, ForcesToBeDisplayed);
        }
コード例 #19
0
        public RESTRequestTest(ITestOutputHelper output)
        {
            _output = output;

            _testInputClass = new InputClass()
            {
                Message = "test input"
            };
            _testOutputClass = new OutputClass()
            {
                Message = "test output"
            };

            var httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(JsonConvert.SerializeObject(_testOutputClass))
            };
            var httpMessageHanderStub = new HttpMessageHandlerStub((request, cancellationToken) => Task.FromResult(httpResponseMessage));

            _httpClient  = new HttpClient(httpMessageHanderStub);
            _restRequest = new RESTRequest <OutputClass, InputClass>(_httpClient);
        }
コード例 #20
0
        /// <summary>
        ///     The OnSaveBookRecordButton_Clicked
        ///     If not series save book title.
        ///     If series save book title, book series name, book volume number.
        /// </summary>
        /// <param name="sender">The source of the event.<see cref="object" />The source of the event.</param>
        /// <param name="e">The e<see cref="System.EventArgs" />Instance containing the event data.</param>
        private void OnSaveBookRecordButton_Clicked(object sender, EventArgs e)
        {
            _msgBox.NameOfMethod = MethodBase.GetCurrentMethod().Name;

            var clsOutput = new OutputClass();

            var filePath = BookListPathsProperties.PathOfCurrentWorkingFile;

            if (!chkSeries.Checked)
            {
                clsOutput.WriteAuthorsTitlesToFile(filePath);
                return;
            }

            var seriesOp = new SeriesOperationsClass();

            var bookInfo = seriesOp.FormatBookSeriesData(txtSeries.Text, txtTitle.Text, txtVolume.Text);


            var bookTitle = txtTitle.Text.Trim();
            var retVal    = CheckThatAuthorsFileDoesNotContainThisBookTitle(filePath, bookTitle);


            if (retVal)
            {
                _msgBox.Msg = "This book title is all ready contained in the authors file.";
                _msgBox.ShowInformationMessageBox();
                return;
            }

            if (clsOutput.WriteAuthorsTitlesSeriesToFile(filePath, bookInfo))
            {
                _msgBox.Msg = "The book title and series information have been successfully saved. ";
                _msgBox.ShowInformationMessageBox();
            }
        }
コード例 #21
0
        private void GetAttachmentPointForces(OutputClass _ocLeft, OutputClass _ocRight, out Vector3D _Force_P_Left, out Vector3D _Force_Q_Left, out Vector3D _Force_P_Right, out Vector3D _Force_Q_Right, bool _SRack, bool _SColumn)
        {
            _Force_P_Left = _Force_P_Right = _Force_Q_Left = _Force_Q_Right = new Vector3D();
            if (_SRack)
            {
                _Force_P_Left  = new Vector3D(_ocLeft.RackInboard1_x, _ocLeft.RackInboard1_y, _ocLeft.RackInboard1_z);
                _Force_Q_Left  = new Vector3D(_ocLeft.RackInboard2_x, _ocLeft.RackInboard2_y, _ocLeft.RackInboard2_z);
                _Force_P_Right = new Vector3D(_ocRight.RackInboard1_x, _ocRight.RackInboard1_y, _ocRight.RackInboard1_z);
                _Force_Q_Right = new Vector3D(_ocRight.RackInboard2_x, _ocRight.RackInboard2_y, _ocRight.RackInboard2_z);
            }
            else if (!_SRack)
            {
                _Force_P_Left  = new Vector3D(_ocLeft.ARBInboard1_x, _ocLeft.ARBInboard1_y, _ocLeft.ARBInboard1_z);
                _Force_Q_Left  = new Vector3D(_ocLeft.ARBInboard2_x, _ocLeft.ARBInboard2_y, _ocLeft.ARBInboard2_z);
                _Force_P_Right = new Vector3D(_ocRight.ARBInboard1_x, _ocRight.ARBInboard1_y, _ocRight.ARBInboard1_z);
                _Force_Q_Right = new Vector3D(_ocRight.ARBInboard2_x, _ocRight.ARBInboard2_y, _ocRight.ARBInboard2_z);
            }

            if (_SColumn)
            {
                _Force_P_Left  = new Vector3D(_ocLeft.SColumnInboard1_x, _ocLeft.SColumnInboard1_y, _ocLeft.SColumnInboard1_z);
                _Force_P_Right = new Vector3D(_ocLeft.SColumnInboard2_x, _ocLeft.SColumnInboard2_y, _ocLeft.SColumnInboard2_z);
            }
        }
コード例 #22
0
 public Artifact(string name, string relativePath, OutputClass outputClass)
 {
     Name         = name;
     RelativePath = relativePath;
     OutputClass  = outputClass;
 }
コード例 #23
0
ファイル: Tutorial.cs プロジェクト: clintonm9/NBALifeTest
    // Main begins program execution.
    public static void Main2()
    {
        // Instance of OutputClass
           // OutputClass outCl = new OutputClass("This is printed by the output class.");
        OutputClass outCl = new OutputClass("1","2");
        // Call Output class' method
        outCl.printString();

        OutputClass oc2 = new OutputClass("OutputClass2");
        oc2.printString();
        OutputClass.staticPrinter();
    }
コード例 #24
0
ファイル: Program33.cs プロジェクト: mootoomeepo/mootoo.meepo
        static void Main(string[] args)
        {
            string currentDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            currentDir = currentDir.Replace("file:\\", "");

            string connString = "Data Source=" + currentDir + "/parity_check.license;Pooling=True;Password=mootoo-meepo-wergweguowh2rg134243terbdssdff";
            SQLiteConnection conn = new SQLiteConnection(connString);
            conn.Open();

            int[] p = new int[9] {
                0,1,2,3,4,5,6,7,8
            };
            Move perfect = new Move(p,9, -1,0);

            string createTableSql = "CREATE TABLE IF NOT EXISTS \"" + tableName + "\" (\"pos\" char(" + perfect.signature.Length + ") PRIMARY KEY,\"before_empty\" INTEGER NOT NULL, \"num_steps\" INTEGER NOT NULL, \"checked\" INTEGER NOT NULL);";

            ExecuteDbCommand(createTableSql, conn);


            try
            {
                ExecuteDbCommand("INSERT INTO "+tableName+" (pos,before_empty,num_steps,checked) VALUES ('" + perfect.signature + "','" + perfect.emptyBefore + "','" + perfect.level + "','0');", conn);
                //q.Enqueue(perfect);
            }
            catch (SQLiteException e)
            {
                
            }

            isRunning = true;
            OutputClass o = new OutputClass();
            new Thread(new ThreadStart(o.output)).Start();

            count = GetNum(conn);
            while (true)
            {
                Move m = GetNext(conn);

                if (m == null) break;

                Move[] newMoves = new Move[] {
                        m.UpMove(),m.RightMove(),m.LeftMove(),m.DownMove()
                    };

                for (int i = 0; i < newMoves.Length; i++)
                {
                    if (newMoves[i] == null) continue;
                    try
                    {
                        ExecuteDbCommand("INSERT INTO " + tableName + " (pos,before_empty,num_steps,checked) VALUES ('" + newMoves[i].signature + "','" + newMoves[i].emptyBefore + "','" + newMoves[i].level + "','0');", conn);

                        count++;
                        lastLevel = newMoves[i].level;

                        //if (newMoves[i].level < 25) q.Enqueue(newMoves[i]);
                    }
                    catch (SQLiteException e)
                    {
                        
                    }
                }

                ExecuteDbCommand("UPDATE " + tableName + " SET checked='1' WHERE pos='" + m.signature + "'", conn);

            }

            isRunning = false;

            Console.WriteLine("DONE");
            Console.ReadLine();
        }
コード例 #25
0
        private void OutputDrawer(CAD vehicleCADDrawer_Output, int VehicleIndex, int OutputIndex, bool _importCAD, bool _plotWheel)
        {
            try
            {
                //vehicleCADDrawer_Output = new CAD();

                vehicleCADDrawer_Output.GetCoG(Vehicle.List_Vehicle[VehicleIndex].chassis_vehicle);



                ///<remarks> Plotting the Front Left Outputs. CP Forces which are calculated are passed so that the arrows can be plotted for them <seealso cref="CAD.PlotArrows(double, double, double, double, double, double, bool)"/></remarks>
                vehicleCADDrawer_Output.SuspensionPlotterInvoker(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP, 1, Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].waOP, false, _plotWheel, Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex],
                                                                 Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FL_Fx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FL_Fy + Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].CW, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FL_Fz);

                ///<remarks> Plotting the Front Right Outputs. CP Forces which are calculated are passed so that the arrows can be plotted for them <seealso cref="CAD.PlotArrows(double, double, double, double, double, double, bool)"/></remarks>
                vehicleCADDrawer_Output.SuspensionPlotterInvoker(Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex].scmOP, 2, Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex].waOP, false, _plotWheel, Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex],
                                                                 Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FR_Fx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FR_Fy + Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex].CW, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FR_Fz);

                ///<remarks> Plotting the Rear Left Outputs. CP Forces which are calculated are passed so that the arrows can be plotted for them <seealso cref="CAD.PlotArrows(double, double, double, double, double, double, bool)"/></remarks>
                vehicleCADDrawer_Output.SuspensionPlotterInvoker(Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex].scmOP, 3, Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex].waOP, false, _plotWheel, Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex],
                                                                 Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RL_Fx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RL_Fy + Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex].CW, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RL_Fz);

                ///<remarks> Plotting the Rear Right Outputs. CP Forces which are calculated are passed so that the arrows can be plotted for them <seealso cref="CAD.PlotArrows(double, double, double, double, double, double, bool)"/></remarks>
                vehicleCADDrawer_Output.SuspensionPlotterInvoker(Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex].scmOP, 4, Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex].waOP, false, _plotWheel, Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex],
                                                                 Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RR_Fx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RR_Fy + Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex].CW, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RR_Fz);


                vehicleCADDrawer_Output.ARBConnector(vehicleCADDrawer_Output.CoordinatesFL.InboardPickUp, vehicleCADDrawer_Output.CoordinatesFR.InboardPickUp);


                vehicleCADDrawer_Output.SteeringCSystemPlotter(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP, Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex].scmOP, vehicleCADDrawer_Output.CoordinatesFL.InboardPickUp, vehicleCADDrawer_Output.CoordinatesFR.InboardPickUp);


                vehicleCADDrawer_Output.ARBConnector(vehicleCADDrawer_Output.CoordinatesRL.InboardPickUp, vehicleCADDrawer_Output.CoordinatesRR.InboardPickUp);

                Vector3D ForcePLeft, ForceQLeft, ForcePRight, ForceQRight = new Vector3D();
                ///<summary>Obtaining the Forces in the FL, FR, RL, RR Steering Rack Points of the FRONT</summary>
                GetAttachmentPointForces(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], out ForcePLeft, out ForceQLeft, out ForcePRight, out ForceQRight, true, false);
                CADVehicleOutputs.PlotLoadCase(Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.FL_BearingCoordinates, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.FR_BearingCoordinates, false, true, false, ForcePLeft, ForceQLeft, ForcePRight, ForceQRight);

                ///<summary>Obtaining the Forces in the FL, FR, RL, RR ARB Points of the FRONT</summary>
                GetAttachmentPointForces(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], out ForcePLeft, out ForceQLeft, out ForcePRight, out ForceQRight, false, false);
                CADVehicleOutputs.PlotLoadCase(Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.FL_BearingCoordinates, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.FR_BearingCoordinates, false, false, false, ForcePLeft, ForceQLeft, ForcePRight, ForceQRight);

                ///<summary>Obtaining the Forces in the FL, FR, RL, RR Steering Rack Points of the REAR</summary>
                GetAttachmentPointForces(Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex], out ForcePLeft, out ForceQLeft, out ForcePRight, out ForceQRight, false, false);
                CADVehicleOutputs.PlotLoadCase(Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.RL_BearingCoordinates, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.RR_BearingCoordinates, false, true, false, ForcePLeft, ForceQLeft, ForcePRight, ForceQRight);

                ///<summary>Using manipulation to obtain the forces on the Left and Right Steering Column Attachment Points</summary>
                GetAttachmentPointForces(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], out ForcePLeft, out ForceQLeft, out ForcePRight, out ForceQRight, false, true);
                CADVehicleOutputs.PlotLoadCase(Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.SteeringColumnBearing, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.SteeringColumnBearing, false, true, true, ForcePLeft, new Vector3D(), ForcePRight, new Vector3D());

                vehicleCADDrawer_Output.PlotLoadCaseInputForces(Vehicle.List_Vehicle[this._VehicleID - 1].chassis_vehicle, Vehicle.List_Vehicle[this._VehicleID - 1].vehicleLoadCase);

                vehicleCADDrawer_Output.PlotMomentArrows(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP.W1x, Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP.W1y, Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP.W1z,
                                                         Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.NSM_FL_Mx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.NSM_FL_Mz);

                ///<remarks>Order of Painting is Important</remarks>
                ///<summary>Creating a temporary Output Class Variable which will hold the Max and Min Values collated from ALL THE 4 CORNERS</summary>
                OutputClass MasterOC = new OutputClass();
                MasterOC = MasterOC.PopulateForceLists(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex]);

                ///<summary>Calling the <see cref="LegendEditor"/> and initializing it and then calling the <see cref="CAD.PostProcessing(LegendEditor, OutputClass, Color, Color, GradientStyle, int, double)"/> method which draws the DataTable for the Legend and the Legend too </summary>
                LoadCaseLegend.InitializeLegendEditor(MasterOC, CADVehicleOutputs);

                ///<summary>This Loop exists to allow the imported files to be translated around the Suspension  </summary>
                if (_importCAD && OutputIGESPlotted && TranslateChassisToGround)
                {
                    r1 = Kinematics_Software_New.AssignFormVariable();

                    int opIndex = 0;

                    int motionInd = Vehicle.List_Vehicle[_VehicleID - 1].vehicle_Motion.MotionID - 1;

                    opIndex = MotionGUI.List_MotionGUI[motionInd].bandedGridView_Motion.FocusedRowHandle;

                    ImportedCADTranslationHistory.Add(-Vehicle.List_Vehicle[_VehicleID - 1].oc_FL[opIndex].FinalRideHeight_1);

                    for (int i = 0; i < vehicleCADDrawer_Output.viewportLayout1.Entities.Count; i++)
                    {
                        if (vehicleCADDrawer_Output.viewportLayout1.Entities[i] is BlockReference)
                        {
                            BlockReference br = vehicleCADDrawer_Output.viewportLayout1.Entities[i] as BlockReference;
                            br.Translate(0, -(ImportedCADTranslationHistory[ImportedCADTranslationHistory.Count - 1] - ImportedCADTranslationHistory[ImportedCADTranslationHistory.Count - 2]), 0);
                        }
                    }
                }

                devDept.Eyeshot.RegenOptions ro = new devDept.Eyeshot.RegenOptions();
                vehicleCADDrawer_Output.viewportLayout1.Entities.Regen(ro);
                vehicleCADDrawer_Output.viewportLayout1.Invalidate();
            }
            catch (Exception E)
            {
                MessageBox.Show(E.Message);
                // Keeping this code in try and catch block will help during Open operation. If the method is called without a Vehicle or VehicleGUI item being present, then the software won't crasha
            }
        }
コード例 #26
0
ファイル: BuildDb.cs プロジェクト: mootoomeepo/mootoo.meepo
        static void Main(string[] args)
        {
            tableName += "" + dimension;

            string currentDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            currentDir = currentDir.Replace("file:\\", "");

            string connString = "Data Source=" + currentDir + "/key_vault.license;Pooling=True";//;Password=mootoo-meepo-wergweguowh2rg134243terbdssdff";
            SQLiteConnection conn = new SQLiteConnection(connString);
            conn.Open();

            int[] p = new int[dimension * dimension];
            for (int i = 0; i < p.Length; i++) p[i] = i;


            DbMove perfect = new DbMove(p, "XXX", 0, dimension, dimension);

            string createTableSql = "CREATE TABLE IF NOT EXISTS \"" + tableName + "\" (\"pos\" char(100) PRIMARY KEY,\"move\" char(3) NOT NULL, \"num_steps\" INTEGER NOT NULL, \"checked\" INTEGER NOT NULL);";

            ExecuteDbCommand(createTableSql, conn);


            try
            {
                ExecuteDbCommand("INSERT INTO " + tableName + " (pos,move,num_steps,checked) VALUES ('" + perfect.signature + "','" + perfect.move + "','" + perfect.level + "','0');", conn);
                //q.Enqueue(perfect);
            }
            catch (SQLiteException e)
            {

            }

            isRunning = true;
            OutputClass o = new OutputClass();
            new Thread(new ThreadStart(o.output)).Start();


            int clickD = dimension - 1;
            int clickD2 = clickD * clickD;

            count = GetNum(conn);
            while (true)
            {
                DbMove m = GetNext(conn);

                if (m == null) break;

                DbMove[] newMoves = new DbMove[clickD2 * 2];

                for (int k = 0; k < newMoves.Length; k++)
                {
                    if ((k % 2) == 0)
                        newMoves[k] = m.GenMove(k / 2, DbMove.Direction.CLOCKWISE);
                    else
                        newMoves[k] = m.GenMove(k / 2, DbMove.Direction.COUNTER_CLOCKWISE);
                }

                for (int i = 0; i < newMoves.Length; i++)
                {
                    if (newMoves[i] == null) continue;
                    try
                    {
                        ExecuteDbCommand("INSERT INTO " + tableName + " (pos,move,num_steps,checked) VALUES ('" + newMoves[i].signature + "','" + newMoves[i].move + "','" + newMoves[i].level + "','0');", conn);

                        count++;
                        lastLevel = newMoves[i].level;

                        //if (newMoves[i].level < 25) q.Enqueue(newMoves[i]);
                    }
                    catch (SQLiteException e)
                    {

                    }
                }

                ExecuteDbCommand("UPDATE " + tableName + " SET checked='1' WHERE pos='" + m.signature + "'", conn);

            }

            isRunning = false;

            Console.WriteLine("DONE");
            Console.ReadLine();
        }
コード例 #27
0
        public static void Rounder_Outputs(OutputClass _ocRounder)
        {
            #region Rounding off to 3 decimals
            _ocRounder.scmOP.A1x = Math.Round(_ocRounder.scmOP.A1x, 3);
            _ocRounder.scmOP.A1y = Math.Round(_ocRounder.scmOP.A1y, 3);
            _ocRounder.scmOP.A1z = Math.Round(_ocRounder.scmOP.A1z, 3);

            _ocRounder.scmOP.B1x = Math.Round(_ocRounder.scmOP.B1x, 3);
            _ocRounder.scmOP.B1y = Math.Round(_ocRounder.scmOP.B1y, 3);
            _ocRounder.scmOP.B1z = Math.Round(_ocRounder.scmOP.B1z, 3);

            _ocRounder.scmOP.C1x = Math.Round(_ocRounder.scmOP.C1x, 3);
            _ocRounder.scmOP.C1y = Math.Round(_ocRounder.scmOP.C1y, 3);
            _ocRounder.scmOP.C1z = Math.Round(_ocRounder.scmOP.C1z, 3);

            _ocRounder.scmOP.D1x = Math.Round(_ocRounder.scmOP.D1x, 3);
            _ocRounder.scmOP.D1y = Math.Round(_ocRounder.scmOP.D1y, 3);
            _ocRounder.scmOP.D1z = Math.Round(_ocRounder.scmOP.D1z, 3);

            _ocRounder.scmOP.E1x = Math.Round(_ocRounder.scmOP.E1x, 3);
            _ocRounder.scmOP.E1y = Math.Round(_ocRounder.scmOP.E1y, 3);
            _ocRounder.scmOP.E1z = Math.Round(_ocRounder.scmOP.E1z, 3);

            _ocRounder.scmOP.F1x = Math.Round(_ocRounder.scmOP.F1x, 3);
            _ocRounder.scmOP.F1y = Math.Round(_ocRounder.scmOP.F1y, 3);
            _ocRounder.scmOP.F1z = Math.Round(_ocRounder.scmOP.F1z, 3);

            _ocRounder.scmOP.G1x = Math.Round(_ocRounder.scmOP.G1x, 3);
            _ocRounder.scmOP.G1y = Math.Round(_ocRounder.scmOP.G1y, 3);
            _ocRounder.scmOP.G1z = Math.Round(_ocRounder.scmOP.G1z, 3);

            _ocRounder.scmOP.H1x = Math.Round(_ocRounder.scmOP.H1x, 3);
            _ocRounder.scmOP.H1y = Math.Round(_ocRounder.scmOP.H1y, 3);
            _ocRounder.scmOP.H1z = Math.Round(_ocRounder.scmOP.H1z, 3);

            _ocRounder.scmOP.I1x = Math.Round(_ocRounder.scmOP.I1x, 3);
            _ocRounder.scmOP.I1y = Math.Round(_ocRounder.scmOP.I1y, 3);
            _ocRounder.scmOP.I1z = Math.Round(_ocRounder.scmOP.I1z, 3);

            _ocRounder.scmOP.JO1x = Math.Round(_ocRounder.scmOP.JO1x, 3);
            _ocRounder.scmOP.JO1y = Math.Round(_ocRounder.scmOP.JO1y, 3);
            _ocRounder.scmOP.JO1z = Math.Round(_ocRounder.scmOP.JO1z, 3);

            _ocRounder.scmOP.J1x = Math.Round(_ocRounder.scmOP.J1x, 3);
            _ocRounder.scmOP.J1y = Math.Round(_ocRounder.scmOP.J1y, 3);
            _ocRounder.scmOP.J1z = Math.Round(_ocRounder.scmOP.J1z, 3);

            _ocRounder.scmOP.K1x = Math.Round(_ocRounder.scmOP.K1x, 3);
            _ocRounder.scmOP.K1y = Math.Round(_ocRounder.scmOP.K1y, 3);
            _ocRounder.scmOP.K1z = Math.Round(_ocRounder.scmOP.K1z, 3);

            _ocRounder.scmOP.L1x = Math.Round(_ocRounder.scmOP.L1x, 3);
            _ocRounder.scmOP.L1y = Math.Round(_ocRounder.scmOP.L1y, 3);
            _ocRounder.scmOP.L1z = Math.Round(_ocRounder.scmOP.L1z, 3);

            _ocRounder.scmOP.M1x = Math.Round(_ocRounder.scmOP.M1x, 3);
            _ocRounder.scmOP.M1y = Math.Round(_ocRounder.scmOP.M1y, 3);
            _ocRounder.scmOP.M1z = Math.Round(_ocRounder.scmOP.M1z, 3);

            _ocRounder.scmOP.N1x = Math.Round(_ocRounder.scmOP.N1x, 3);
            _ocRounder.scmOP.N1y = Math.Round(_ocRounder.scmOP.N1y, 3);
            _ocRounder.scmOP.N1z = Math.Round(_ocRounder.scmOP.N1z, 3);

            _ocRounder.scmOP.O1x = Math.Round(_ocRounder.scmOP.O1x, 3);
            _ocRounder.scmOP.O1y = Math.Round(_ocRounder.scmOP.O1y, 3);
            _ocRounder.scmOP.O1z = Math.Round(_ocRounder.scmOP.O1z, 3);

            _ocRounder.scmOP.P1x = Math.Round(_ocRounder.scmOP.P1x, 3);
            _ocRounder.scmOP.P1y = Math.Round(_ocRounder.scmOP.P1y, 3);
            _ocRounder.scmOP.P1z = Math.Round(_ocRounder.scmOP.P1z, 3);

            _ocRounder.scmOP.Q1x = Math.Round(_ocRounder.scmOP.Q1x, 3);
            _ocRounder.scmOP.Q1y = Math.Round(_ocRounder.scmOP.Q1y, 3);
            _ocRounder.scmOP.Q1z = Math.Round(_ocRounder.scmOP.Q1z, 3);

            _ocRounder.scmOP.R1x = Math.Round(_ocRounder.scmOP.R1x, 3);
            _ocRounder.scmOP.R1y = Math.Round(_ocRounder.scmOP.R1y, 3);
            _ocRounder.scmOP.R1z = Math.Round(_ocRounder.scmOP.R1z, 3);

            _ocRounder.scmOP.W1x = Math.Round(_ocRounder.scmOP.W1x, 3);
            _ocRounder.scmOP.W1y = Math.Round(_ocRounder.scmOP.W1y, 3);
            _ocRounder.scmOP.W1z = Math.Round(_ocRounder.scmOP.W1z, 3);
            #endregion
        }
コード例 #28
0
 /// <summary>
 /// Creates a <see cref="OutputDesc"/> representing a <see cref="Texture"/>
 /// </summary>
 /// <param name="type">The <see cref="OutputClass"/> for the output desc</param>
 /// <param name="format">The <see cref="DataFormat"/> for the output desc</param>
 /// <param name="width">The width, in texels, of the output</param>
 /// <param name="height">The height, in texels, of the output, if it is 2D</param>
 /// <param name="depthOrArraySize">The depth, in texels, if the resource is 3D, else the array size of the output</param>
 /// <returns>A new <see cref="OutputDesc"/> representing a <see cref="Texture"/></returns>
 public static OutputDesc CreateTexture(OutputClass type, DataFormat format, ulong width, uint height = 1, ushort depthOrArraySize = 1)
 => new OutputDesc
 {
     ResourceType = ResourceType.Texture, Format = format, Type = type, TextureWidth = width, TextureHeight = height, TextureDepthOrArraySize = depthOrArraySize
 };
コード例 #29
0
 /// <summary>
 /// Creates a <see cref="OutputDesc"/> representing a <see cref="Buffer"/>
 /// </summary>
 /// <param name="type">The <see cref="OutputClass"/> for the output desc</param>
 /// <param name="length">The length, in bytes, of the output</param>
 /// <returns>A new <see cref="OutputDesc"/> representing a <see cref="Buffer"/></returns>
 public static OutputDesc CreateBuffer(OutputClass type, ulong length)
 => new OutputDesc
 {
     ResourceType = ResourceType.Texture, Type = type, BufferLength = length
 };
コード例 #30
0
        /// <summary>
        /// Creates an <see cref="OutputDesc"/> from a <see cref="Output"/>
        /// </summary>
        /// <param name="type">The <see cref="OutputClass"/> for the output desc</param>
        /// <param name="output">The <see cref="Output"/> to build this desc from</param>
        /// <returns>A new <see cref="OutputDesc"/> representing <paramref name="output"/></returns>
        public static OutputDesc FromBackBuffer(OutputClass type, Output output)
        {
            var back = output.OutputBuffer;

            return(CreateTexture(type, back.Format, back.Width, back.Height, back.DepthOrArraySize));
        }
コード例 #31
0
        static void Main(string[] args)
        {
            string currentDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            currentDir = currentDir.Replace("file:\\", "");

            string connString = "Data Source=" + currentDir + "/pattern.sqlite;Pooling=True";
            SQLiteConnection conn = new SQLiteConnection(connString);
            conn.Open();

            string createTableSql = "CREATE TABLE IF NOT EXISTS \"block_colors\" (\"pos\" char(45) PRIMARY KEY,\"move\" char(2) NOT NULL, \"num_steps\" INTEGER NOT NULL, \"checked\" INTEGER NOT NULL);";

            ExecuteDbCommand(createTableSql, conn);

            //ExecuteDbCommand("DELETE FROM block_colors;", conn);

            int[,] p = new int[9, 9] {
                {0,0,0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0,0,0},
                {0,0,0,1,1,1,0,0,0},
                {0,0,0,1,1,1,0,0,0},
                {0,0,0,1,1,1,0,0,0},
                {0,0,0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0,0,0},
                {0,0,0,0,0,0,0,0,0}
            };

            //q = new Queue<LookupMove>();

            LookupMove perfect = new LookupMove(p, "", 0);

            try
            {
                ExecuteDbCommand("INSERT INTO block_colors (pos,move,num_steps,checked) VALUES ('" + perfect.pos + "','" + perfect.move + "','" + perfect.level + "','0');", conn);
                //q.Enqueue(perfect);
            }
            catch (SQLiteException e)
            {
                
            }

            isRunning = true;
            OutputClass o = new OutputClass();
            new Thread(new ThreadStart(o.output)).Start();

            count = GetNum(conn);
            while (true)
            {
                //if (q.Count == 0) break;

                //LookupMove m = q.Dequeue();
                LookupMove m = GetNext(conn);

                if (m == null) break;

                LookupMove[] newMoves = new LookupMove[] {
                        m.next(0,'U'),m.next(1,'U'), m.next(2,'U'),
                        m.next(0,'D'),m.next(1,'D'), m.next(2,'D'),
                        m.next(0,'R'),m.next(1,'R'), m.next(2,'R'),
                        m.next(0,'L'),m.next(1,'L'), m.next(2,'L')
                    };

                for (int i = 0; i < newMoves.Length; i++)
                {
                    try
                    {
                        ExecuteDbCommand("INSERT INTO block_colors (pos,move,num_steps,checked) VALUES ('" + newMoves[i].pos + "','" + newMoves[i].move + "','" + newMoves[i].level + "','0');", conn);

                        count++;
                        lastLevel = newMoves[i].level;

                        //if (newMoves[i].level < 25) q.Enqueue(newMoves[i]);
                    }
                    catch (SQLiteException e)
                    {
                        
                    }
                }

                ExecuteDbCommand("UPDATE block_colors SET checked='1' WHERE pos='" + m.pos + "'", conn);

            }

            isRunning = false;

            Console.WriteLine("DONE");
            Console.ReadLine();
        }
コード例 #32
0
 public static void TranslateCoordinates_DropToGround(Vehicle _vehicleTranslations, OutputClass _ocTranslations)
 {
     #region Dropping the Vehicle to the Ground
     //Fixed Points
     _ocTranslations.scmOP.A1y   -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.B1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.C1y   -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.D1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.I1y   -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.JO1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.N1y   -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.Pin1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.UV1y  -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.UV2y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.STC1y -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.Q1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.R1y   -= _ocTranslations.FinalRideHeight_ForTrans;
     //Moving Points
     _ocTranslations.scmOP.J1y -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.H1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.O1y -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.G1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.F1y -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.E1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.M1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.K1y -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.L1y -= _ocTranslations.FinalRideHeight_ForTrans;
     _ocTranslations.scmOP.P1y -= _ocTranslations.FinalRideHeight_ForTrans; _ocTranslations.scmOP.W1y -= _ocTranslations.FinalRideHeight_ForTrans;
     //_ocTranslations.scmOP.FinalRideHeight_ForTrans -= _ocTranslations.scmOP.FinalRideHeight_ForTrans;
     #endregion
 }
コード例 #33
0
 public void SetClass(OutputClass outputClass)
 {
     Class = outputClass;
 }
コード例 #34
0
        /// <summary>
        /// Method to display the Outputs of Each Setup Change. If a particular param is not requested the initial value is shown
        /// </summary>
        /// <param name="_oc"></param>
        /// <param name="_setupOP"></param>
        /// <param name="_cv"></param>
        /// <param name="_resultsGUI"></param>
        /// <param name="_resultsGrid"></param>
        /// <param name="_converged"></param>
        public void DisplayIndividualOutputs(OutputClass _oc, SetupChange_Outputs _setupOP, SetupChange_CornerVariables _cv, XUC_SetupChangeResults _resultsGUI, VGridControl _resultsGrid, ref bool _converged)
        {
            string test = _cv.kpiAdjustmentTool.ToString();

            ///<summary>Assining the KPI Outputs</summary>
            _resultsGrid.SetCellValue(_resultsGUI.rowKPIAngle, 1, Convert.ToString(Math.Round(Angle.FromRadians(_oc.KPI).Degrees, 2)) + " | " + Convert.ToString(Math.Round(_setupOP.Calc_KPI.Degrees, 2)));
            if (_cv.KPIChangeRequested || _cv.constKPI || _cv.CasterChangeRequested || _cv.constCaster)
            {
                if (_cv.Master_Adj["Caster/KPI"].ContainsKey(AdjustmentTools.TopFrontArm.ToString()))
                {
                    _resultsGrid.SetCellValue(_resultsGUI.rowTopFrontAdj, 1, Convert.ToString(Math.Round(_setupOP.TopFrontLength, 3)));
                    _resultsGUI.rowTopFrontAdj.Visible = true;
                }
                else
                {
                    _resultsGUI.rowTopFrontAdj.Visible = false;
                }
                if (_cv.Master_Adj["Caster/KPI"].ContainsKey(AdjustmentTools.TopRearArm.ToString()))
                {
                    _resultsGrid.SetCellValue(_resultsGUI.rowTopRearAdj, 1, Convert.ToString(Math.Round(_setupOP.TopRearLength, 3)));
                    _resultsGUI.rowTopRearAdj.Visible = true;
                }
                else
                {
                    _resultsGUI.rowTopRearAdj.Visible = false;
                }
                if (_cv.Master_Adj["Caster/KPI"].ContainsKey(AdjustmentTools.BottomFrontArm.ToString()))
                {
                    _resultsGrid.SetCellValue(_resultsGUI.rowBottomFrontAdj, 1, Convert.ToString(Math.Round(_setupOP.BottomFrontLength, 3)));
                    _resultsGUI.rowBottomFrontAdj.Visible = true;
                }
                else
                {
                    _resultsGUI.rowBottomFrontAdj.Visible = false;
                }
                if (_cv.Master_Adj["Caster/KPI"].ContainsKey(AdjustmentTools.BottomRearArm.ToString()))
                {
                    _resultsGrid.SetCellValue(_resultsGUI.rowBottomRearAdj, 1, Convert.ToString(Math.Round(_setupOP.BottomRearLength, 3)));
                    _resultsGUI.rowBottomRearAdj.Visible = true;
                }
                else
                {
                    _resultsGUI.rowBottomRearAdj.Visible = false;
                }
            }
            else
            {
                _resultsGUI.rowTopFrontAdj.Visible    = false;
                _resultsGUI.rowTopRearAdj.Visible     = false;
                _resultsGUI.rowBottomFrontAdj.Visible = false;
                _resultsGUI.rowBottomRearAdj.Visible  = false;
            }
            _resultsGrid.SetCellValue(_resultsGUI.rowKPIConvergance, 1, _setupOP.KPI_Conv.ConvergenceStatus);


            ///<summary>Assingint the Caster Outputs</summary>
            _resultsGrid.SetCellValue(_resultsGUI.rowCasterAngle, 1, Convert.ToString(Math.Round(Angle.FromRadians(_oc.Caster).Degrees, 2)) + " | " + Convert.ToString(Math.Round(_setupOP.Calc_Caster.Degrees, 2)));
            _resultsGrid.SetCellValue(_resultsGUI.rowCasterConvergance, 1, _setupOP.Caster_Conv.ConvergenceStatus);


            ///<summary>Assining the Camber Outputs</summary>
            _resultsGrid.SetCellValue(_resultsGUI.rowCamberAngle, 1, Convert.ToString(Math.Round(Angle.FromRadians(_oc.waOP.StaticCamber).Degrees, 3)) + " | " + Convert.ToString(Math.Round(_setupOP.Calc_Camber.Degrees, 3)));
            if (_cv.CamberChangeRequested || _cv.constCamber)
            {
                if (_cv.Master_Adj["Camber"].ContainsKey(AdjustmentTools.TopCamberMount.ToString()))
                {
                    _resultsGrid.SetCellValue(_resultsGUI.rowTopCamberMount, 1, Convert.ToString(Math.Round(_setupOP.TopCamberShimsLength, 3)));
                    _resultsGrid.SetCellValue(_resultsGUI.rowShimsTopCamberMount, 1, Convert.ToString(Math.Round(_setupOP.TopCamberShimsNo, 3)));
                    _resultsGUI.rowTopCamberMount.Visible = true;
                }
                else
                {
                    _resultsGUI.rowTopCamberMount.Visible = false;
                }
                if (_cv.Master_Adj["Camber"].ContainsKey(AdjustmentTools.BottomCamberMount.ToString()))
                {
                    _resultsGrid.SetCellValue(_resultsGUI.rowBottomCamberMount, 1, Convert.ToString(Math.Round(_setupOP.BottomCamberShimsLength, 3)));
                    _resultsGrid.SetCellValue(_resultsGUI.rowShimsBottomCamberMount, 1, Convert.ToString(Math.Round(_setupOP.BottomCamberShimsNo, 3)));
                    _resultsGUI.rowBottomCamberMount.Visible = true;
                }
                else
                {
                    _resultsGUI.rowBottomCamberMount.Visible = false;
                }
            }
            else
            {
                _resultsGUI.rowTopCamberMount.Visible    = false;
                _resultsGUI.rowBottomCamberMount.Visible = false;
            }
            _resultsGrid.SetCellValue(_resultsGUI.rowCamberConvergance, 1, _setupOP.Camber_Conv.ConvergenceStatus);


            ///<summary>Assigning the Toe Outputs</summary>
            _resultsGrid.SetCellValue(_resultsGUI.rowToeAngle, 1, Convert.ToString(Math.Round(Angle.FromRadians(_oc.waOP.StaticToe).Degrees, 3)) + " | " + Convert.ToString(Math.Round(_setupOP.Calc_Toe.Degrees, 3)));
            if (_cv.ToeChangeRequested || _cv.constToe)
            {
                if (_cv.Master_Adj["Toe"].ContainsKey(AdjustmentTools.ToeLinkLength.ToString()))
                {
                    _resultsGrid.SetCellValue(_resultsGUI.rowToeLink, 1, Convert.ToString(Math.Round(_setupOP.ToeLinklength, 3)));
                    _resultsGUI.rowToeLink.Visible = true;
                }
                else
                {
                    _resultsGUI.rowToeLink.Visible = false;
                }
            }
            else
            {
                _resultsGUI.rowToeLink.Visible = false;
            }
            _resultsGrid.SetCellValue(_resultsGUI.rowToeConvergance, 1, _setupOP.Toe_Conv.ConvergenceStatus);


            ///<summary>Assigning the Ride Height</summary>
            _resultsGrid.SetCellValue(_resultsGUI.rowRideHeight, 1, _setupOP.Calc_RideHeight);
            _resultsGrid.SetCellValue(_resultsGUI.rowLinkRHName, 1, _cv.rideheightAdjustmentTool.ToString());
            _resultsGrid.SetCellValue(rowLinkRHDelta, 1, Convert.ToString(Math.Round(_setupOP.PushrodLength, 3)));
            _resultsGrid.SetCellValue(_resultsGUI.rowRHConvergance, 1, _setupOP.RideHeight_Conv.ConvergenceStatus);


            ///<summary>Setting the results of the Bump Steer</summary>
            if (_cv.BumpSteerChangeRequested)
            {
                _resultsGrid.SetCellValue(rowToeLinkInboard_x, 1, Convert.ToString(Math.Round(_setupOP.ToeLinkInboard.X, 3)));
                _resultsGUI.rowToeLinkInboard_x.Visible = true;
                _resultsGrid.SetCellValue(rowToeLinkInboard_y, 1, Convert.ToString(Math.Round(_setupOP.ToeLinkInboard.Y, 3)));
                _resultsGUI.rowToeLinkInboard_y.Visible = true;
                _resultsGrid.SetCellValue(rowToeLinkInboard_z, 1, Convert.ToString(Math.Round(_setupOP.ToeLinkInboard.Z, 3)));
                _resultsGUI.rowToeLinkInboard_z.Visible = true;
            }
            else
            {
                _resultsGUI.rowToeLinkInboard_x.Visible = false;
                _resultsGUI.rowToeLinkInboard_y.Visible = false;
                _resultsGUI.rowToeLinkInboard_z.Visible = false;
            }

            _resultsGrid.SetCellValue(rowBSConvergence, 1, _setupOP.BumpSteer_Conv.ConvergenceStatus);
        }