예제 #1
0
 public MipsInterfaceMemory() : base(0x10000, 0x10, 0x04300000)
 {
     InitModeReg = new R0(this, 0);
     VersionReg  = new R1(this, 1);
     IntrReg     = new R2(this, 2);
     IntrMaskReg = new R3(this, 3);
 }
예제 #2
0
        public ActionResult Index()
        {
            Character character = this.HttpContext.Items["Character"] as Character;

            if (character == null)
            {
                return(HttpNotFound());
            }

            var query = from r1 in db.GeneratedItems
                        from r2 in db.Items
                        join r3 in db.Images on r2.ImageId equals r3.ID into R3
                        from r8 in R3.DefaultIfEmpty()
                        join r4 in db.Affixes on r1.PrefixId equals r4.Id into R4
                        from r5 in R4.DefaultIfEmpty()
                        join r6 in db.Affixes on r1.SuffixId equals r6.Id into R6
                        from r7 in R6.DefaultIfEmpty()
                        where r1.CharacterId == character.Id && r1.ItemId == r2.Id
                        select new ItemViewModel
            {
                GeneratedItem = r1,
                Item          = r2,
                Image         = r8 != null ? r8 : null,
                Prefix        = r5 != null ? r5 : null,
                Suffix        = r7 != null ? r7 : null
            };

            List <ItemViewModel> characterItems = query.ToList();

            return(View(characterItems));
        }
예제 #3
0
        protected override void Check()
        {
            Bind(nameof(base.R1), nameof(P1));
            Bind(nameof(base.R2), nameof(P2));
            Bind <Action <int> >(nameof(base.R3), nameof(P3));
            Bind <Func <int> >(nameof(base.R3), nameof(P3));
            Bind(nameof(R1), nameof(Q1));
            Bind(nameof(R2), nameof(Q2));
            Bind <Action <int> >(nameof(R3), nameof(Q3));
            Bind <Func <int> >(nameof(R3), nameof(Q3));

            _x = 10;
            base.R1.ShouldBe(5);

            base.R2 = 12;
            _x.ShouldBe(24);

            base.R3.ShouldBe(48);
            base.R3 = 12;
            _x.ShouldBe(6);

            _x = 10;
            R1.ShouldBe(8);

            R2 = 12;
            _x.ShouldBe(14);

            R3.ShouldBe(16);
            R3 = 12;
            _x.ShouldBe(10);
        }
예제 #4
0
 internal R0Linker()
 {
     r0 = new R0();
     r1 = new R1();
     r2 = new R2();
     r3 = new R3();
     r4 = new R4();
 }
예제 #5
0
 private void btnClear_Click(object sender, EventArgs e)
 {
     R1.ReadOnly = false;
     R1.Clear();
     R2.Clear();
     R3.Clear();
     R4.Clear();
     resultado.Clear();
 }
예제 #6
0
 private void Play_Click(object sender, EventArgs e)
 {
     R1.Show();
     R2.Show();
     R3.Show();
     R4.Show();
     Play.Hide();
     Sair.Hide();
     ExibeProximaQuestao();
 }
        static void Main(string[] args)
        {
            decimal R1 = (decimal)1112.82;                                                      //声明整型变量R1,并赋值为1112.82
            decimal R2 = (decimal)9270.81;                                                      //声明整型变量R2,并赋值为9270.81
            decimal R3;                                                                         //声明整型变量R3

            R3 = R2 - R1;                                                                       //R3的值为R2减去R1得到的值
            Console.WriteLine(R3.ToString());
            Console.Read();
        }
예제 #8
0
 private void btnAcumula_Click(object sender, EventArgs e)
 {
     if (resultado.Text != "")
     {
         acumula     = double.Parse(resultado.Text);
         R1.ReadOnly = true;
         R1.Text     = acumula.ToString("0.00");
         R2.Clear();
         R3.Clear();
         R4.Clear();
     }
     else
     {
         MessageBox.Show("\"Resultado\" vazio");
     }
 }
예제 #9
0
        public void GetEntryForDocument(string idrelated)
        {
            D = new DataSet();
            string filterrelated = QHS.AppAnd(QHS.Like("idrelated", idrelated),
                                              QHS.CmpEq("yentry", Meta.GetSys("esercizio")));
            DataTable T = Conn.RUN_SELECT("entry", "*", null, filterrelated, null, true);

            D.Tables.Add(T);
            if (T.Rows.Count == 0)
            {
                DataTable TT2 = Conn.CreateTableByName("entrydetail", "*");
                D.Tables.Add(TT2);
                D.Relations.Add("entryentrydetail",
                                new DataColumn[] { T.Columns["yentry"], T.Columns["nentry"] },
                                new DataColumn[] { TT2.Columns["yentry"], TT2.Columns["nentry"] }, false);
                return;
            }
            DataRow   Entry = T.Rows[0];
            string    key   = QHS.CmpKey(Entry);
            string    filtercurryeardetail = key;
            DataTable TT = Conn.RUN_SELECT("entrydetail", "*", null, filtercurryeardetail, null, true);

            D.Tables.Add(TT);
            D.Relations.Add("entryentrydetail",
                            new DataColumn[] { T.Columns["yentry"], T.Columns["nentry"] },
                            new DataColumn[] { TT.Columns["yentry"], TT.Columns["nentry"] }, false);

            DataTable TT3 = Conn.RUN_SELECT("entrydetailaccrual", "*", null, filtercurryeardetail, null, true);

            D.Tables.Add(TT3);
            D.Relations.Add("entrydetailentrydetailaccrual",
                            new DataColumn[] { TT.Columns["yentry"], TT.Columns["nentry"], TT.Columns["ndetail"] },
                            new DataColumn[] { TT3.Columns["yentry"], TT3.Columns["nentry"], TT3.Columns["ndetail"] },
                            false);
            if (TT3.Rows.Count > 0)
            {
                MessageBox.Show("Ci sono ratei associati alle scritture che saranno scollegati. Sarà " +
                                "necessario ricollegarli a mano");
                foreach (DataRow R3 in TT3.Rows)
                {
                    R3.Delete();
                }
            }
        }
예제 #10
0
        public ControllerPS3(params int[] joystickId)
        {
            AddButton(Controls.Triangle);
            AddButton(Controls.Circle);
            AddButton(Controls.Cross);
            AddButton(Controls.Square);
            AddButton(Controls.R1);
            AddButton(Controls.L1);
            AddButton(Controls.L3);
            AddButton(Controls.R3);
            AddButton(Controls.Start);
            AddButton(Controls.Select);
            AddButton(Controls.R2);
            AddButton(Controls.L2);

            AddAxis(Controls.LStick);
            AddAxis(Controls.RStick);
            AddAxis(Controls.DPad);

            foreach (var joy in joystickId)
            {
                Triangle.AddJoyButton(0, joy);
                Circle.AddJoyButton(1, joy);
                Cross.AddJoyButton(2, joy);
                Square.AddJoyButton(3, joy);
                L2.AddJoyButton(4, joy);
                R2.AddJoyButton(5, joy);
                L1.AddJoyButton(6, joy);
                R1.AddJoyButton(7, joy);
                Select.AddJoyButton(8, joy);
                Start.AddJoyButton(9, joy);
                L3.AddJoyButton(10, joy);
                R3.AddJoyButton(11, joy);

                R2.AddAxisButton(AxisButton.ZMinus, joy);
                L2.AddAxisButton(AxisButton.ZPlus, joy);

                LeftStick.AddJoyAxis(JoyAxis.X, JoyAxis.Y, joy);
                RightStick.AddJoyAxis(JoyAxis.U, JoyAxis.R, joy);
                DPad.AddJoyAxis(JoyAxis.PovX, JoyAxis.PovY, joy);
            }
        }
예제 #11
0
        public ActionResult Index()
        {
            Character character = this.HttpContext.Items["Character"] as Character;

            if (character == null)
            {
                return(HttpNotFound());
            }

            var query2 = from r1 in db.GeneratedItems
                         from r2 in db.Items
                         join r3 in db.Images on r2.ImageId equals r3.ID into R3
                         from r8 in R3.DefaultIfEmpty()
                         join r4 in db.Affixes on r1.PrefixId equals r4.Id into R4
                         from r5 in R4.DefaultIfEmpty()
                         join r6 in db.Affixes on r1.SuffixId equals r6.Id into R6
                         from r7 in R6.DefaultIfEmpty()
                         where r1.CharacterId == character.Id && r1.ItemId == r2.Id
                         select new ItemViewModel
            {
                GeneratedItem = r1,
                Item          = r2,
                Image         = r8 != null ? r8 : null,
                Prefix        = r5 != null ? r5 : null,
                Suffix        = r7 != null ? r7 : null
            };

            List <ItemViewModel> characterItems = query2.ToList();

            EquipmentViewModel equipmentViewModel = new EquipmentViewModel();

            equipmentViewModel.EquippedItems =
                characterItems.FindAll(i => i.GeneratedItem.Status == ItemStatus.Equipped);
            equipmentViewModel.BackpackItems =
                characterItems.FindAll(i => i.GeneratedItem.Status == ItemStatus.Bagpack);
            equipmentViewModel.ChestItems =
                characterItems.FindAll(i => i.GeneratedItem.Status == ItemStatus.Chest);

            return(View(equipmentViewModel));
        }
    static int Main()
    {
        R1   myobj = new R1();
        int  res   = 0;
        long lres;

        MyProxy real_proxy = new MyProxy(myobj);

        R1 o = (R1)real_proxy.GetTransparentProxy();

        if (RemotingServices.IsTransparentProxy(null))
        {
            return(1);
        }

        if (!RemotingServices.IsTransparentProxy(o))
        {
            return(2);
        }

        Console.WriteLine("XXXXXXXXXXXX: " + RemotingServices.GetRealProxy(o));

        if (o.GetType() != myobj.GetType())
        {
            return(3);
        }

        MyStruct myres = o.Add(2, out res, 3);

        Console.WriteLine("Result: " + myres.a + " " +
                          myres.b + " " + myres.c + " " + res);

        if (myres.a != 2)
        {
            return(4);
        }

        if (myres.b != 3)
        {
            return(5);
        }

        if (myres.c != 5)
        {
            return(6);
        }

        if (res != 5)
        {
            return(7);
        }

        R1 o2 = new R1();

        lres = test_call(o2);

        lres = test_call(o);

        Console.WriteLine("Result: " + lres);
        if (lres != 5)
        {
            return(8);
        }

        lres = test_call(o);

        o.test_field = 2;

        Console.WriteLine("test_field: " + o.test_field);
        if (o.test_field != 2)
        {
            return(9);
        }

        RemoteDelegate1 d1     = new RemoteDelegate1(o.Add);
        MyStruct        myres2 = d1(2, out res, 3);

        Console.WriteLine("Result: " + myres2.a + " " +
                          myres2.b + " " + myres2.c + " " + res);

        if (myres2.a != 2)
        {
            return(10);
        }

        if (myres2.b != 3)
        {
            return(11);
        }

        if (myres2.c != 5)
        {
            return(12);
        }

        if (res != 5)
        {
            return(13);
        }

        RemoteDelegate2 d2 = new RemoteDelegate2(o.nonvirtual_Add);

        d2(6, 7);

        if (!(real_proxy.GetTransparentProxy() is R2))
        {
            return(14);
        }

        /* Test what happens if the proxy doesn't return the required information */
        EmptyProxy handler = new EmptyProxy(typeof(R3));
        R3         o3      = (R3)handler.GetTransparentProxy();

        if (o3.anObject != null)
        {
            return(15);
        }

        if (o.null_test_field != null)
        {
            return(16);
        }

        return(0);
    }
예제 #13
0
    // Update is called once per frame
    void Update()
    {
        if (FindEnemyR)
        {
            Vector3 closeEnemyPos1;
            Vector3 closeEnemyPos2;
            Vector3 closeEnemyPos3;
            if (GameObject.FindGameObjectWithTag("EnemyR") != null)
            {
                CloseEn1       = FindClosestEnemyC1();
                CloseEn2       = FindClosestEnemyC2();
                CloseEn3       = FindClosestEnemyC3();
                closeEnemyPos1 = new Vector3(CloseEn1.transform.position.x, CloseEn1.transform.position.y, CloseEn1.transform.position.z);
                closeEnemyPos2 = new Vector3(CloseEn2.transform.position.x, CloseEn2.transform.position.y, CloseEn2.transform.position.z);
                closeEnemyPos3 = new Vector3(CloseEn3.transform.position.x, CloseEn3.transform.position.y, CloseEn3.transform.position.z);

                WhereToFireRC1 = closeEnemyPos1 - Fire_1.position;
                WhereToFireRC2 = closeEnemyPos2 - Fire_2.position;
                WhereToFireRC3 = closeEnemyPos3 - Fire_3.position;
            }
            else
            {
                time = 0;
            }
        }

        if (TimerOn)
        {
            time++;
            if (time == reload)
            {
                Vector3 FirePos_1 = Fire_1.position;
                //TempBulletRC1 = Instantiate (BulletRC1, FirePos_1, BulletRC1.transform.rotation) as GameObject;

                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn1;

                Bullet.transform.position = FirePos_1;


                Bullet.SetActive(true);
                R1.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireRC1.normalized * bullectRSpeed;
                Bullet.GetComponent <TrailRenderer> ().Clear();
            }
            else if (time == reload * 2)
            {
                Vector3 FirePos_2 = Fire_2.position;

                //TempBulletRC2 = Instantiate (BulletRC2, FirePos_2, BulletRC2.transform.rotation);
                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn2;

                Bullet.transform.position = FirePos_2;


                Bullet.SetActive(true);
                R2.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireRC2.normalized * bullectRSpeed;
                Bullet.GetComponent <TrailRenderer> ().Clear();
            }
            else if (time == reload * 3)
            {
                Vector3 FirePos_3 = Fire_3.position;
                //TempBulletRC3 = Instantiate (BulletRC3, FirePos_3, BulletRC3.transform.rotation);
                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn3;

                Bullet.transform.position = FirePos_3;

                Bullet.SetActive(true);
                R3.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireRC3.normalized * bullectRSpeed;
                Bullet.GetComponent <TrailRenderer> ().Clear();

                time    = 0;
                TimerOn = false;
            }
        }
        else
        {
            FindEnemyR = false;
        }
    }
예제 #14
0
        public void Inicio()
        {
            Point p = new Point();                      // Creamos un punto que nos ayudará a mover las reinas

            p.X         = 78;                           // Punto X inicial de la Reina 5
            p.Y         = 317;                          // Punto Y inicial de la Reina 5
            R5.Location = p;                            // Cambiamos la locación de la Reina 5

            p.X         = 78;                           // Punto X inicial de la Reina 4
            p.Y         = 258;                          // Punto Y inicial de la Reina 4
            R4.Location = p;                            // Cambiamos la locación de la Reina 4

            p.X         = 78;                           // Punto X inicial de la Reina 3
            p.Y         = 199;                          // Punto Y inicial de la Reina 3
            R3.Location = p;                            // Cambiamos la locación de la Reina 3

            p.X         = 78;                           // Punto X inicial de la Reina 2
            p.Y         = 140;                          // Punto Y inicial de la Reina 2
            R2.Location = p;                            // Cambiamos la locación de la Reina 2

            p.X         = 78;                           // Punto X inicial de la Reina 1
            p.Y         = 80;                           // Punto Y inicial de la Reina 1
            R1.Location = p;                            // Cambiamos la locación de la Reina 1
            R1.Refresh();                               // Refrescamos los pictureboxs para tener la imagen actual de como se verían

            for (int i = 0; i < 5; i++)                 // Ciclo que mueve la Reina 1
            {
                for (int j = 0; j < 5; j++)             // Ciclo que mueve la Reina 2
                {
                    for (int k = 0; k < 5; k++)         // Cliclo que mueve la Reina 3
                    {
                        for (int l = 0; l < 5; l++)     // Ciclo que mueve la Reina 2
                        {
                            for (int m = 0; m < 5; m++) // Ciclo que mueve la Reina 1
                            {
                                tablero[0] = i;         // Colocamos la Reina 1
                                tablero[1] = j;         // Colocamos la Reina 2
                                tablero[2] = k;         // Colocamos la Reina 3
                                tablero[3] = l;         // Colocamos la Reina 4
                                tablero[4] = m;         // Colocamos la Reina 5

                                Thread.Sleep(20);       // Asignamos la velocidad con la que se moverán las reinas

                                // Imprimir picturebox
                                if (Verificar())                                                                                                   // Sí la función devuelve verdadero
                                {
                                    if (MessageBox.Show("Encontró una solución", "!SOLUCION¡", MessageBoxButtons.OKCancel) == DialogResult.Cancel) // Mostramos un mensaje que dice sí queremos continuar o terminar el proceso
                                    {
                                        return;                                                                                                    // Sí damos click en "Cancelar" se tendrá que empezar de nuevo
                                    }
                                }

                                Tablero.Refresh();                    // Refrescamos a la imagen actual del Tablero

                                if (m + 1 != 5)                       // Si la Reina 5 está en la posición 5, no moveremos las reina
                                {
                                    p.X         = R5.Location.X + 59; // Cambiamos el punto X de la Reina 5
                                    p.Y         = R5.Location.Y;      // Cambiamos el punto Y de la Reina 5
                                    R5.Location = p;                  // Movemos la locación de la Reina 5
                                    R5.Refresh();                     // Refrescamos a la imagen actual de la Reina 5
                                }
                            } // Fin for de m

                            p.X         = 78;                     // Cambiamos el punto X al inicial de la Reina 5
                            p.Y         = 317;                    // Cambiamos el punto Y al inicial de la Reina 5
                            R5.Location = p;                      // Movemos la Reina 5 a su punto inicial

                            if (l + 1 != 5)                       // Si la Reina 4 está en la posición 5, no moveremos las reina
                            {
                                p.X         = R4.Location.X + 59; // Cambiamos el punto X de la Reina 4
                                p.Y         = R4.Location.Y;      // Cambiamos el punto Y de la Reina 4
                                R4.Location = p;                  // Movemos la locación de la Reina 4
                            }

                            R4.Refresh(); // Refrescamos a la imagen actual de la Reina 4
                        } // Fin for de l

                        p.X         = 78;                     // Cambiamos el punto X al inicial de la Reina 4
                        p.Y         = 258;                    // Cambiamos el punto Y al inicial de la Reina 4
                        R4.Location = p;                      // Movemos la Reina 4 a su punto inicial

                        if (k + 1 != 5)                       // Si la Reina 3 está en la posición 5, no moveremos las reina
                        {
                            p.X         = R3.Location.X + 59; // Cambiamos el punto X de la Reina 3
                            p.Y         = R3.Location.Y;      // Cambiamos el punto Y de la Reina 3
                            R3.Location = p;                  // Movemos la locación de la Reina 3
                        }

                        R3.Refresh(); // Refrescamos a la imagen actual de la Reina 3
                    } // Fin for de k

                    p.X         = 78;                     // Cambiamos el punto X al inicial de la Reina 3
                    p.Y         = 199;                    // Cambiamos el punto Y al inicial de la Reina 3
                    R3.Location = p;                      // Movemos la Reina 3 a su punto inicial

                    if (j + 1 != 5)                       // Si la Reina 2 está en la posición 5, no moveremos las reina
                    {
                        p.X         = R2.Location.X + 59; // Cambiamos el punto X de la Reina 2
                        p.Y         = R2.Location.Y;      // Cambiamos el punto Y de la Reina 2
                        R2.Location = p;                  // Movemos la locación de la Reina 2
                    }

                    R2.Refresh(); // Refrescamos a la imagen actual de la Reina 2
                } // Fin for de j

                p.X         = 78;                     // Cambiamos el punto X al inicial de la Reina 2
                p.Y         = 140;                    // Cambiamos el punto Y al inicial de la Reina 2
                R2.Location = p;                      // Movemos la Reina 2 a su punto inicial

                if (i + 1 != 5)                       // Si la Reina 1 está en la posición 5, no moveremos las reina
                {
                    p.X         = R1.Location.X + 59; // Cambiamos el punto X de la Reina 1
                    p.Y         = R1.Location.Y;      // Cambiamos el punto Y de la Reina 1
                    R1.Location = p;                  // Movemos la locación de la Reina 1
                }

                R1.Refresh(); // Refrescamos a la imagen actual de la Reina 1
            } // Fin for de i

            p.X         = 78; // Cambiamos el punto X al inicial de la Reina 1
            p.Y         = 80; // Cambiamos el punto Y al inicial de la Reina 1
            R1.Location = p;  // Movemos la Reina 1 a su punto inicial
            R1.Refresh();     // Refrescamos la imagen a la inicial
        }
예제 #15
0
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            if (Bars == null)
            {
                return;
            }
            if (!Bars.BarsType.IsIntraday && Bars.Period.Id != PeriodType.Day)
            {
                return;
            }
            if (Bars.Period.Id == PeriodType.Day && pivotRangeType == PivotRange.Daily)
            {
                return;
            }
            if (Bars.Period.Id == PeriodType.Day && Bars.Period.Value > 1)
            {
                return;
            }

            // pivots only work for
            // - intraday
            // - 1 day chart with PivotRange Weekly or Monthly

            if (!isDailyDataLoaded)
            {
                if (priorDayHLC == HLCCalculationMode.DailyBars && Bars.BarsType.IsIntraday)
                {
                    Enabled = false;
                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(GetBarsNow));
                    return;
                }

                existsHistDailyData = false;
                isDailyDataLoaded   = true;
            }

            IBar dailyBar;

            if (existsHistDailyData)
            {
                sessionDateDaily = GetLastBarSessionDate(Time[0], Bars, PivotRange.Daily);
                dailyBar         = dailyBars.Get(dailyBars.GetBar(sessionDateDaily));

                if (dailyBar.Time.Date > sessionDateDaily.Date)
                {
                    for (DateTime i = sessionDateDaily; i >= dailyBars.GetTime(0); i = i.AddDays(-1))
                    {
                        dailyBar = dailyBars.Get(dailyBars.GetBar(i));
                        if (dailyBar.Time.Date == i.Date)
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                dailyBar = null;
            }

            double high  = existsHistDailyData ? dailyBar.High : High[0];
            double low   = existsHistDailyData ? dailyBar.Low : Low[0];
            double close = existsHistDailyData ? dailyBar.Close : Close[0];

            DateTime lastBarTimeStamp = GetLastBarSessionDate(Time[0], Bars, pivotRangeType);

            if ((currentDate != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Daily && lastBarTimeStamp != currentDate) ||
                (currentWeek != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Weekly && lastBarTimeStamp != currentWeek) ||
                (currentMonth != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Monthly && lastBarTimeStamp != currentMonth))
            {
                pp           = (currentHigh + currentLow + currentClose) / 3;
                s1           = 2 * pp - currentHigh;
                r1           = 2 * pp - currentLow;
                s2           = pp - (currentHigh - currentLow);
                r2           = pp + (currentHigh - currentLow);
                s3           = pp - 2 * (currentHigh - currentLow);
                r3           = pp + 2 * (currentHigh - currentLow);
                ppr1         = (pp + r1) / 2;
                pps1         = (pp + s1) / 2;
                r1r2         = (r1 + r2) / 2;
                s1s2         = (s1 + s2) / 2;
                r2r3         = (r2 + r3) / 2;
                s2s3         = (s2 + s3) / 2;
                currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedClose : close;
                currentHigh  = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedHigh : high;
                currentLow   = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedLow : low;
            }
            else
            {
                currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedClose : close;
                currentHigh  = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedHigh : Math.Max(currentHigh, high);
                currentLow   = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedLow : Math.Min(currentLow, low);
            }

            if (pivotRangeType == PivotRange.Daily)
            {
                currentDate = lastBarTimeStamp;
            }
            if (pivotRangeType == PivotRange.Weekly)
            {
                currentWeek = lastBarTimeStamp;
            }
            if (pivotRangeType == PivotRange.Monthly)
            {
                currentMonth = lastBarTimeStamp;
            }

            if ((pivotRangeType == PivotRange.Daily && currentDate != Cbi.Globals.MinDate) ||
                (pivotRangeType == PivotRange.Weekly && currentWeek != Cbi.Globals.MinDate) ||
                (pivotRangeType == PivotRange.Monthly && currentMonth != Cbi.Globals.MinDate))
            {
                PP.Set(pp);
                R1.Set(r1);
                S1.Set(s1);
                R2.Set(r2);
                S2.Set(s2);
                R3.Set(r3);
                S3.Set(s3);
                //    PPR1.Set(ppr1);
                //    PPS1.Set(pps1);
                //    R1R2.Set(r1r2);
                //    S1S2.Set(s1s2);
                //    R2R3.Set(r2r3);
                //    S2S3.Set(s2s3);
            }
        }
예제 #16
0
    static int Main()
    {
        R1   myobj = new R1();
        int  res   = 0;
        long lres;

        MyProxy real_proxy = new MyProxy(myobj);

        R1 o = (R1)real_proxy.GetTransparentProxy();

        if (RemotingServices.IsTransparentProxy(null))
        {
            return(1);
        }

        if (!RemotingServices.IsTransparentProxy(o))
        {
            return(2);
        }

        Console.WriteLine("XXXXXXXXXXXX: " + RemotingServices.GetRealProxy(o));

        if (o.GetType() != myobj.GetType())
        {
            return(3);
        }

        MyStruct myres = o.Add(2, out res, 3);

        Console.WriteLine("Result: " + myres.a + " " +
                          myres.b + " " + myres.c + " " + res);

        if (myres.a != 2)
        {
            return(4);
        }

        if (myres.b != 3)
        {
            return(5);
        }

        if (myres.c != 5)
        {
            return(6);
        }

        if (res != 5)
        {
            return(7);
        }

        R1 o2 = new R1();

        lres = test_call(o2);

        lres = test_call(o);

        Console.WriteLine("Result: " + lres);
        if (lres != 5)
        {
            return(8);
        }

        lres = test_call(o);

        o.test_field = 2;

        int i = o.test_field;          // copy to local variable necessary to avoid CS1690: "Accessing a member on 'member' may cause a runtime exception because it is a field of a marshal-by-reference class"

        Console.WriteLine("test_field: " + i);
        if (i != 2)
        {
            return(9);
        }

        RemoteDelegate1 d1     = new RemoteDelegate1(o.Add);
        MyStruct        myres2 = d1(2, out res, 3);

        Console.WriteLine("Result: " + myres2.a + " " +
                          myres2.b + " " + myres2.c + " " + res);

        if (myres2.a != 2)
        {
            return(10);
        }

        if (myres2.b != 3)
        {
            return(11);
        }

        if (myres2.c != 5)
        {
            return(12);
        }

        if (res != 5)
        {
            return(13);
        }

        RemoteDelegate2 d2 = new RemoteDelegate2(o.nonvirtual_Add);

        d2(6, 7);

        if (!(real_proxy.GetTransparentProxy() is R2))
        {
            return(14);
        }

        /* Test what happens if the proxy doesn't return the required information */
        EmptyProxy handler = new EmptyProxy(typeof(R3));
        R3         o3      = (R3)handler.GetTransparentProxy();

        if (o3.anObject != null)
        {
            return(15);
        }

        if (o.null_test_field != null)
        {
            return(16);
        }

        return(0);
    }
예제 #17
0
    // Update is called once per frame
    void Update()
    {
        if (FindPlayerR)
        {
            Vector3 PlayerPos1;

            PlayerPos1     = FindPlayer().transform.position;
            WhereToFireRC1 = PlayerPos1 - FirePos1.transform.position;
            WhereToFireRC2 = PlayerPos1 - FirePos2.transform.position;
            WhereToFireRC3 = PlayerPos1 - FirePos3.transform.position;
        }

        if (TimerOn)
        {
            time++;
            if (time == reload)
            {
                //Debug.Log ("대포 발사1");
                GameObject enemyBullet1 = ObjectPooling.pool.GetPoolObject_EnemyBullet();
                if (enemyBullet1 == null)
                {
                    return;
                }

                enemyBullet1.transform.position = FirePos1.transform.position;
                enemyBullet1.transform.GetChild(0).GetComponent <TrailRenderer>().Clear();

                enemyBullet1.SetActive(true);
                R1.Play();

                enemyBullet1.GetComponent <Rigidbody> ().velocity = WhereToFireRC1.normalized * bullectRSpeed;
            }
            else if (time == reload * 2)
            {
                GameObject enemyBullet2 = ObjectPooling.pool.GetPoolObject_EnemyBullet();
                if (enemyBullet2 == null)
                {
                    return;
                }

                enemyBullet2.transform.position = FirePos2.transform.position;
                enemyBullet2.transform.GetChild(0).GetComponent <TrailRenderer>().Clear();

                enemyBullet2.SetActive(true);
                R2.Play();

                enemyBullet2.GetComponent <Rigidbody>().velocity = WhereToFireRC2.normalized * bullectRSpeed;
            }
            else if (time == reload * 3)
            {
                GameObject enemyBullet3 = ObjectPooling.pool.GetPoolObject_EnemyBullet();
                if (enemyBullet3 == null)
                {
                    return;
                }

                enemyBullet3.transform.position = FirePos3.transform.position;
                enemyBullet3.transform.GetChild(0).GetComponent <TrailRenderer>().Clear();

                enemyBullet3.SetActive(true);
                R3.Play();

                enemyBullet3.GetComponent <Rigidbody>().velocity = WhereToFireRC3.normalized * bullectRSpeed;

                time    = 0;
                TimerOn = false;
            }
        }
        else
        {
            FindPlayerR = false;
        }
    }
 public virtual void testReflectionWithMap()
 {
     StringTemplate.setLintMode(true);
     StringTemplate a = new StringTemplate("$attributes$");
     StringTemplateErrorListener errors = new ErrorBuffer();
     a.setErrorListener(errors);
     Hashtable map = new Hashtable();
     a.setAttribute("stuff", map);
     map["prop1"] = "Terence";
     map["prop2"] = new R3();
     String results = a.ToString();
     //System.out.println(results);
     String expecting = "Template anonymous:" + newline +
     "    1. Attribute stuff values:" + newline +
     "        1. Key prop1 : String" + newline +
     "        2. Key prop2 : TestStringTemplate+R3" + newline +
     "            1. Property anotherMap : Hashtable" + newline +
     "            2. Property aMap : IDictionary" + newline +
     "                1. Key v : String" + newline +
     "            3. Property email : String" + newline;
     StringTemplate.setLintMode(false);
     Assert.AreEqual(results, expecting);
 }
예제 #19
0
    static void Main()
    {
        int    n = 5, m = 4;
        matrix A1  = new matrix(n, m);
        var    rnd = new Random(1);

        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < m; j++)
            {
                A1[i, j] = 2 * (rnd.NextDouble() - 0.5);
            }
        }
        WriteLine("____Assignment A1____");
        A1.print($"QR-decomposition:\nrandom {n}x{m} matrix A:");
        (matrix Q, matrix R1) = qrDecomp.qr_gs_decomp(A1);
        R1.print("matrix R:");
        matrix QTQ = Q.T * Q;
        matrix QR  = Q * R1;

        QTQ.print("Q^T*Q:");
        QR.print("Q*R:");
        if (A1.approx(QR))
        {
            WriteLine("Q*R=A, test passed");
        }
        else
        {
            WriteLine("Q*R!=A, test failed");
        }
        Write("\n\n");


        matrix A2 = new matrix(n, n);

        rnd = new Random(2);
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                A2[i, j] = 2 * (rnd.NextDouble() - 0.5);
            }
        }
        vector b = new vector(n);

        rnd = new Random(3);
        for (int i = 0; i < n; i++)
        {
            b[i] = 2 * (rnd.NextDouble() - 0.5);
        }
        WriteLine("____Assignment A2____");
        A2.print($"Solving system of equations A*x=Q*R*x=b:\nrandom {n}x{n} matrix A:");
        (matrix Q2, matrix R2) = qrDecomp.qr_gs_decomp(A2);
        Q2.print("matrix Q:");
        R2.print("matrix R:");
        b.print("vector b:");
        vector x2  = qrDecomp.qr_gs_solve(Q2, R2, b);
        vector Ax2 = A2 * x2;

        x2.print("solution vector x:");
        Ax2.print("A*x:");
        if (b.approx(A2 * x2))
        {
            WriteLine("A*x=b, test passed");
        }
        else
        {
            WriteLine("A*x!=b, test failed");
        }
        Write("\n\n");


        matrix A3 = new matrix(n, n);

        rnd = new Random(4);
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                A3[i, j] = 2 * (rnd.NextDouble() - 0.5);
            }
        }
        WriteLine("____Assignment B____");
        A3.print($"Decomposing A into Q*R:\nrandom {n}x{n} matrix A:");
        (matrix Q3, matrix R3) = qrDecomp.qr_gs_decomp(A3);
        Q3.print("matrix Q:");
        R3.print("matrix R:");
        matrix B = qrDecomp.qr_gs_inverse(Q3, R3);
        matrix I = new matrix(n, n);

        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                I[i, j] = 0;
                if (i == j)
                {
                    I[i, j] = 1;
                }
            }
        }
        I.print($"Idenity matrix I({n}):");
        B.print("Inverse matrix B:");
        matrix AB       = A3 * B;
        matrix AB_round = new matrix(n, n); // rounded matrix to 10th decimal to get a nicer output

        for (int i = 0; i <= n - 1; i++)
        {
            for (int j = 0; j <= n - 1; j++)
            {
                AB_round[i, j] = Math.Round((Double)AB[i, j], 10);
            }
        }
        AB_round.print("A*B:");
        if (AB.approx(I))
        {
            WriteLine("A*B=I, test passed");             // test is still with unrounded matrix
        }
        else
        {
            WriteLine("A*B!=I, test failed");
        }
        Write("\n\n");


        WriteLine("____Assignment C____");
        A2.print($"Givens rotation of the same coefficient matrix as in part A(2):\nrandom {n}x{m} matrix A:");
        matrix T = A2.copy();

        qrDecomp.qr_givens_decomp(T);
        T.print("Matrix with R in the upper trinagle and angles of the Givens rotation below, T:");
        b.print("Same vector b as in A(2):");
        vector Gb  = b.copy();
        vector x4  = qrDecomp.qr_givens_solve(T, Gb);
        vector Ax4 = A2 * x4;

        x4.print("solution vector x:");
        Ax4.print("A*x:");
        if (b.approx(A2 * x4))
        {
            WriteLine("A*x=b, test passed");
        }
        else
        {
            WriteLine("A*x!=b, test failed");
        }
        Write("\n\n");
    }
예제 #20
0
        /// <summary>
        /// Builds freight invoice.
        /// Original from https://ps.extra.chrysler.com/sites/itb-ebus/Documents/210FreightPaymentInvoice.pdf
        /// </summary>
        static TS210 BuildFreightInvoice(string controlNumber)
        {
            var result = new TS210();

            //  Transaction Set Identifier Code = “210”
            //  (Motor Carrier Freight Details and Invoice)
            //  Transaction Set Control Number = 00000001
            result.ST = new ST();
            result.ST.TransactionSetIdentifierCode_01 = "210";
            result.ST.TransactionSetControlNumber_02  = controlNumber.PadLeft(9, '0');

            //  Invoice Number = 3410889
            //  Shipment Identification Number = 545930791T
            //  Shipment Method of Payment
            //  = “TP” (Third Party)
            //  Weight Unit Code = “L” (Pounds)
            //  Date = 10 / 31 / 2007
            //  Net Amount Due = 51.65
            //  Delivery Date = 10 / 29 / 2007
            //  Date / Time Qualifier = “035” (Delivered)
            //  Standard Carrier Alpha Code = NLMI
            result.B3 = new B3();
            result.B3.InvoiceNumber_02 = "3410889";
            result.B3.ShipmentIdentificationNumber_03 = "545930791T";
            result.B3.ShipmentMethodofPayment_04      = "TP";
            result.B3.WeightUnitCode_05           = "L";
            result.B3.Date_06                     = "20071031";
            result.B3.NetAmountDue_07             = "5165";
            result.B3.DeliveryDate_09             = "20071029";
            result.B3.DateTimeQualifier_10        = "035";
            result.B3.StandardCarrierAlphaCode_11 = "NLMI";

            //  Currency Code = USD (U.S.)
            result.C3 = new C3();
            result.C3.CurrencyCode_01 = "USD";

            //  Repeating N9
            result.N9 = new List <N9>();

            //  Reference Identification Qualifier = “AE”
            //  (Authorization for Expense<AFE> Number)
            //  Reference Identification = 260451
            var n91 = new N9();

            n91.ReferenceIdentificationQualifier_01 = "AE";
            n91.ReferenceIdentification_02          = "260451";
            result.N9.Add(n91);

            //  Reference Identification Qualifier
            //  = “OP” (Original Purchase Order)
            //  Reference Identification = 3410889
            var n92 = new N9();

            n92.ReferenceIdentificationQualifier_01 = "OP";
            n92.ReferenceIdentification_02          = "3410889";
            result.N9.Add(n92);

            //  Repeating G62
            result.G62 = new List <G62>();

            //  Date Qualifier = “86” (Actual Pickup Date)
            //  Date = 10 / 31 / 2007
            var g62 = new G62();

            g62.DateQualifier_01 = "86";
            g62.Date_02          = "20071031";
            result.G62.Add(g62);

            //  Repeating R3
            result.R3 = new List <R3>();

            //  Standard Carrier Alpha Code = EXEM
            //  Routing Sequence Code
            //  = “B” (Origin / Delivery Carrier < Any Mode >)
            //  Transportation Method/ Type Code
            //  = “AE” (Air Express)
            //  Date = 10 / 31 / 2007
            //  Amount = 379.05
            var r3 = new R3();

            r3.StandardCarrierAlphaCode_01     = "EXEM";
            r3.RoutingSequenceCode_02          = "B";
            r3.TransportationMethodTypeCode_04 = "AE";
            r3.Date_07   = "20071031";
            r3.Amount_08 = "37905";
            result.R3.Add(r3);

            //  Repeating N1 Loops
            result.N1Loop = new List <Loop_N1_210>();

            //  Begin N1 Loop 1
            var n1Loop1 = new Loop_N1_210();

            //  Entity Identifier Code = “SH” (Shipper)
            //  Name = SIEMENS VDO S A DE C V –
            //  SIEMENS AUTOMOTIVE
            //  Identification Code Qualifier
            //  = “94” (Code assigned by the organization that is
            //  the ultimate destination of the transaction set)
            //  Identification Code = 99999
            n1Loop1.N1 = new N1();
            n1Loop1.N1.EntityIdentifierCode_01 = "SH";
            n1Loop1.N1.Name_02 = "SIEMENS VDO S A DE C V - SIEMENS AUTOMOTIVE";
            n1Loop1.N1.IdentificationCodeQualifier_03 = "94";
            n1Loop1.N1.IdentificationCode_04          = "99999";

            //  Repeating N3
            n1Loop1.N3 = new List <N3>();

            //  Address Information
            //  = PERIFERICO SUR 7999D COMPLEJO IND
            var n31 = new N3();

            n31.AddressInformation_01 = "PERIFERICO SUR 7999D COMPLEJO IND";
            n1Loop1.N3.Add(n31);

            //  City Name = TLAQUEPAQUE
            //  State or Province Code = MX
            //  Postal Code = 99999
            //  Country Code = MX
            n1Loop1.N4                        = new N4();
            n1Loop1.N4.CityName_01            = "TLAQUEPAQUE";
            n1Loop1.N4.StateorProvinceCode_02 = "MX";
            n1Loop1.N4.PostalCode_03          = "99999";
            n1Loop1.N4.CountryCode_04         = "MX";

            //  End N1 Loop 1
            result.N1Loop.Add(n1Loop1);

            //  Begin N1 Loop 2
            var n1Loop2 = new Loop_N1_210();

            //  Entity Identifier Code = “CN” (Consignee)
            //  Name = BRAMPTON ASSEMBLY – COLLINS
            //  AND AIKMAN
            //  Identification Code Qualifier
            //  = “94” (Code assigned by the organization that is
            //  the ultimate destination of the transaction set)
            //  Identification Code = 09126B
            n1Loop2.N1 = new N1();
            n1Loop2.N1.EntityIdentifierCode_01 = "CN";
            n1Loop2.N1.Name_02 = "BRAMPTON ASSEMBLY - COLLINS AND AIKMAN";
            n1Loop2.N1.IdentificationCodeQualifier_03 = "94";
            n1Loop2.N1.IdentificationCode_04          = "09126B";

            //  Repeating N3
            n1Loop2.N3 = new List <N3>();

            //  Address Information
            // = 500 LAIRD ROAD~GUELPH PRODUCTS
            var n32 = new N3();

            n32.AddressInformation_01 = "500 LAIRD ROAD";
            n32.AddressInformation_02 = "GUELPH PRODUCTS";
            n1Loop2.N3.Add(n32);

            //  City Name = GUELPH
            //  State or Province Code = ON
            //  Postal Code = 99999
            //  Country Code = CA
            n1Loop2.N4                        = new N4();
            n1Loop2.N4.CityName_01            = "GUELPH";
            n1Loop2.N4.StateorProvinceCode_02 = "ON";
            n1Loop2.N4.PostalCode_03          = "99999";
            n1Loop2.N4.CountryCode_04         = "CA";

            //  End N1 Loop 2
            result.N1Loop.Add(n1Loop2);

            //  Begin N1 Loop 3
            var n1Loop3 = new Loop_N1_210();

            //  Entity Identifier Code = “BT” (Bill-to-Party)
            //  Name = BRAMPTON ASSEMBLY - MAIN
            //  Identification Code Qualifier
            //  = “94” (Code assigned by the organization that is
            //  the ultimate destination of the transaction set)
            //  Identification Code = 09126
            n1Loop3.N1 = new N1();
            n1Loop3.N1.EntityIdentifierCode_01 = "BT";
            n1Loop3.N1.Name_02 = "BRAMPTON ASSEMBLY - MAIN";
            n1Loop3.N1.IdentificationCodeQualifier_03 = "94";
            n1Loop3.N1.IdentificationCode_04          = "09126";

            //  Repeating N3
            n1Loop3.N3 = new List <N3>();

            //  Address Information
            //  = 2000 WILLIAMS PARKWAY EAST
            var n33 = new N3();

            n33.AddressInformation_01 = "2000 WILLIAMS PARKWAY EAST";
            n1Loop3.N3.Add(n33);

            //  City Name = BRAMPTON
            //  State or Province Code = ON
            //  Postal Code = 99999
            //  Country Code = CA
            n1Loop3.N4                        = new N4();
            n1Loop3.N4.CityName_01            = "BRAMPTON";
            n1Loop3.N4.StateorProvinceCode_02 = "ON";
            n1Loop3.N4.PostalCode_03          = "99999";
            n1Loop3.N4.CountryCode_04         = "CA";

            //  End N1 Loop 3
            result.N1Loop.Add(n1Loop3);

            //  Begin N1 Loop 4
            var n1Loop4 = new Loop_N1_210();

            //  Entity Identifier Code = “CA” (Carrier)
            //  Name
            //  = NATIONAL LOGISTICS MANAGEMENT
            //  Identification Code Qualifier
            //  = “94” (Code assigned by the organization that is
            //  the ultimate destination of the transaction set)
            //  Identification Code = 45795
            n1Loop4.N1 = new N1();
            n1Loop4.N1.EntityIdentifierCode_01 = "CA";
            n1Loop4.N1.Name_02 = "NATIONAL LOGISTICS MANAGEMENT";
            n1Loop4.N1.IdentificationCodeQualifier_03 = "94";
            n1Loop4.N1.IdentificationCode_04          = "45795";

            //  Repeating N3
            n1Loop4.N3 = new List <N3>();

            //  Address Information = 14320 JOY RD.
            var n34 = new N3();

            n34.AddressInformation_01 = "14320 JOY RD.";
            n1Loop4.N3.Add(n34);

            //  City Name = DETROIT
            //  State or Province Code = MI
            //  Postal Code = 48228
            //  Country Code = US
            n1Loop4.N4                        = new N4();
            n1Loop4.N4.CityName_01            = "DETROIT";
            n1Loop4.N4.StateorProvinceCode_02 = "MI";
            n1Loop4.N4.PostalCode_03          = "48228";
            n1Loop4.N4.CountryCode_04         = "US";

            //  End N1 Loop 4
            result.N1Loop.Add(n1Loop4);

            //  Begin N1 Loop 5
            var n1Loop5 = new Loop_N1_210();

            //  Entity Identifier Code = “ZZ” (Mutually Defined)
            //  Name = EXPEDITORS / EMERY WORLDWIDE
            //  Identification Code Qualifier
            //  = “94” (Code assigned by the organization that is
            //  the ultimate destination of the transaction set)
            //  Identification Code = 37905
            n1Loop5.N1 = new N1();
            n1Loop5.N1.EntityIdentifierCode_01 = "ZZ";
            n1Loop5.N1.Name_02 = "EXPEDITORS/EMERY WORLDWIDE";
            n1Loop5.N1.IdentificationCodeQualifier_03 = "94";
            n1Loop5.N1.IdentificationCode_04          = "37905";

            //  Repeating N3
            n1Loop5.N3 = new List <N3>();

            //  Address Information = 10881 LOWELL AVENUE
            var n35 = new N3();

            n35.AddressInformation_01 = "10881 LOWELL AVENUE";
            n1Loop5.N3.Add(n35);

            //  City Name = OVERLANDPARK
            //  State or Province Code = KS
            //  Postal Code = 66201
            //  Country Code = US
            n1Loop5.N4                        = new N4();
            n1Loop5.N4.CityName_01            = "OVERLANDPARK";
            n1Loop5.N4.StateorProvinceCode_02 = "KS";
            n1Loop5.N4.PostalCode_03          = "66201";
            n1Loop5.N4.CountryCode_04         = "US";

            //  Repeating N9
            n1Loop5.N9 = new List <N9>();

            //  Reference Identification Qualifier
            //  = “IK” (Invoice Number)
            //  Reference Identification = 545930791T
            var n9 = new N9();

            n9.ReferenceIdentificationQualifier_01 = "IK";
            n9.ReferenceIdentification_02          = "545930791T";
            n1Loop5.N9.Add(n9);

            //  End N1 Loop 5
            result.N1Loop.Add(n1Loop5);

            //  Repeating N7 Loops
            result.N7Loop = new List <Loop_N7_210>();

            //  Begin N7 Loop
            var n7Loop1 = new Loop_N7_210();

            //  Equipment Number = 53456
            //  Equipment Description Code
            //  = “TL” (Trailer < not otherwise specified>)
            //  Equipment Length = 53 Feet
            //  Equipment Type
            //  = “53ST” (53 Foot Standard Trailer)
            n7Loop1.N7 = new N7();
            n7Loop1.N7.EquipmentNumber_02          = "53456";
            n7Loop1.N7.EquipmentDescriptionCode_11 = "TL";
            n7Loop1.N7.EquipmentLength_15          = "5300";
            n7Loop1.N7.EquipmentType_22            = "53ST";

            //  End N7 Loop
            result.N7Loop.Add(n7Loop1);

            //  Repeating LX Loops
            result.LXLoop = new List <Loop_LX_210>();

            //  Begin LX Loop
            var lxLoop1 = new Loop_LX_210();

            //  Assigned Number = 1
            lxLoop1.LX = new LX();
            lxLoop1.LX.AssignedNumber_01 = "1";

            //  Repeating L5
            lxLoop1.L5 = new List <L5>();

            //  Lading Line Item Number= 1
            //  Commodity Code = “2” (Auto Parts)
            //  Commodity Code Qualifier
            //  = “Z” (Mutually defined)
            var l5 = new L5();

            l5.LadingLineItemNumber_01   = "1";
            l5.CommodityCode_03          = "2";
            l5.CommodityCodeQualifier_04 = "Z";
            lxLoop1.L5.Add(l5);

            //  Repeating L0
            lxLoop1.L0 = new List <L0>();

            //  Lading Line Item Number = 1
            //  Billed / Rated -as Quantity = 1499
            //  Billed / Rated -as Qualifier = “FR” (Flat Rate)
            //  Weight = 1499
            //  Weight Qualifier = “G” (Gross)
            //  Weight Unit Code = “L” (Pounds)
            var l0 = new L0();

            l0.LadingLineItemNumber_01   = "1";
            l0.BilledRatedasQuantity_02  = "1499";
            l0.BilledRatedasQualifier_03 = "FR";
            l0.Weight_04          = "1499";
            l0.WeightQualifier_05 = "G";
            l0.WeightUnitCode_11  = "L";
            lxLoop1.L0.Add(l0);

            //  Repeating L0
            lxLoop1.L1 = new List <L1>();

            //  Lading Line Item Number = 1
            //  Freight Rate = 51.65
            //  Rate / Value Qualifier = “FR” (Flat Rate)
            //  Charge = 51.65
            //  Special Charge or Allowance Code
            //  = “400” (Freight)
            var l1 = new L1();

            l1.LadingLineItemNumber_01 = "1";
            l1.FreightRate_02          = "51.65";
            l1.RateValueQualifier_03   = "FR";
            l1.Charge_04 = "5165";
            l1.SpecialChargeorAllowanceCode_08 = "400";
            lxLoop1.L1.Add(l1);

            //  End LX Loop
            result.LXLoop.Add(lxLoop1);

            //  Weight = 2619
            //  Weight Qualifier = “G” (Gross Weight)
            //  Charge = 51.65
            result.L3                    = new L3();
            result.L3.Weight_01          = "2619";
            result.L3.WeightQualifier_02 = "G";
            result.L3.Charge_05          = "5165";

            return(result);
        }
예제 #21
0
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired)
            {
                return;
            }
            if (BarsInProgress == 1)
            {
                if (CurrentBar < 2 * period)
                {
                    return;
                }

                Bars.Session.GetNextBeginEnd(Times[1][0], out sessionBegin, out sessionEnd);

                //sessionDate = Date(sessionBegin);
                //sessionBegin =

                sessionBegin = Convert.ToDateTime(start);
                sessionEnd   = Convert.ToDateTime(start);

                Print("Session Start: " + sessionBegin + "Session End: " + sessionEnd);
                DateTime barTime          = Times[1][0];
                TimeSpan inSessionTime    = barTime.Subtract(sessionBegin);
                int      inSessionMinutes = 60 * inSessionTime.Hours + inSessionTime.Minutes;
                int      cutoff           = inSessionMinutes % period;
                DateTime cutoffTime       = barTime.Subtract(new TimeSpan(0, cutoff, 0));
                int      barsAgo          = CurrentBar - Bars.GetBar(cutoffTime);
                high  = MAX(Highs[1], period)[barsAgo];
                low   = MIN(Lows[1], period)[barsAgo];
                close = Closes[1][barsAgo];
                pp    = (high + low + close) / 3;
                range = high - low;
                r1    = 2 * pp - low;
                r2    = pp + range;
                r3    = r1 + range;
                r4    = r3 + (pp - low);
                s1    = 2 * pp - high;
                s2    = pp - range;
                s3    = s1 - range;
                s4    = s3 - (high - pp);
            }


            if (BarsInProgress == 0)
            {
                if (CurrentBar == 0)
                {
                    return;
                }
                if (pp != 0.0)
                {
                    PP.Set(pp);
                    R1.Set(r1);
                    R2.Set(r2);
                    R3.Set(r3);
                    R4.Set(r4);
                    S1.Set(s1);
                    S2.Set(s2);
                    S3.Set(s3);
                    S4.Set(s4);
                    if (pp != PP[1] || r1 != R1[1] || s1 != S1[1])
                    {
                        PlotColors[0][0] = Color.Transparent;
                        PlotColors[1][0] = Color.Transparent;
                        PlotColors[2][0] = Color.Transparent;
                        PlotColors[3][0] = Color.Transparent;
                        PlotColors[4][0] = Color.Transparent;
                        PlotColors[5][0] = Color.Transparent;
                        PlotColors[6][0] = Color.Transparent;
                        PlotColors[7][0] = Color.Transparent;
                        PlotColors[8][0] = Color.Transparent;
                    }
                }
            }
        }
예제 #22
0
        // Example:
        //
        //    0:009> r
        //     r0=00000000  r1=00000000  r2=00000000  r3=76fdcf09  r4=00000000  r5=028df6e0
        //     r6=028df730  r7=00000000  r8=00000001  r9=01507858 r10=015156a8 r11=028df8e8
        //    r12=00000000  sp=028df6c8  lr=00000000  pc=76ccce24 psr=600f0030 -ZC-- Thumb
        //    KERNELBASE!RaiseFailFastException+0x60:
        //    76ccce24 f000f846 bl          KERNELBASE!SignalStartWerSvc (76ccceb4)
        //
        public override ColorString ToColorString()
        {
            if (null == m_colorString)
            {
                ConsoleColor color;
                ColorString  cs = new ColorString(" r0=");
                color = GetColorForDiffAgainstBaseline("r0");
                cs.Append(R0.GetColorizedValueString(color));
                cs.Append("  r1=");
                color = GetColorForDiffAgainstBaseline("r1");
                cs.Append(R1.GetColorizedValueString(color));
                cs.Append("  r2=");
                color = GetColorForDiffAgainstBaseline("r2");
                cs.Append(R2.GetColorizedValueString(color));
                cs.Append("  r3=");
                color = GetColorForDiffAgainstBaseline("r3");
                cs.Append(R3.GetColorizedValueString(color));
                cs.Append("  r4=");
                color = GetColorForDiffAgainstBaseline("r4");
                cs.Append(R4.GetColorizedValueString(color));
                cs.Append("  r5=");
                color = GetColorForDiffAgainstBaseline("r5");
                cs.Append(R5.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append(" r6=");
                color = GetColorForDiffAgainstBaseline("r6");
                cs.Append(R6.GetColorizedValueString(color));
                cs.Append("  r7=");
                color = GetColorForDiffAgainstBaseline("r7");
                cs.Append(R7.GetColorizedValueString(color));
                cs.Append("  r8=");
                color = GetColorForDiffAgainstBaseline("r8");
                cs.Append(R8.GetColorizedValueString(color));
                cs.Append("  r9=");
                color = GetColorForDiffAgainstBaseline("r9");
                cs.Append(R9.GetColorizedValueString(color));
                cs.Append(" r10=");
                color = GetColorForDiffAgainstBaseline("r10");
                cs.Append(R10.GetColorizedValueString(color));
                cs.Append(" r11=");
                color = GetColorForDiffAgainstBaseline("r11");
                cs.Append(R11.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append("r12=");
                color = GetColorForDiffAgainstBaseline("r12");
                cs.Append(R12.GetColorizedValueString(color));
                cs.Append("  sp=");
                color = GetColorForDiffAgainstBaseline("sp");
                cs.Append(Sp.GetColorizedValueString(color));
                cs.Append("  lr=");
                color = GetColorForDiffAgainstBaseline("lr");
                cs.Append(Lr.GetColorizedValueString(color));
                cs.Append("  pc=");
                color = GetColorForDiffAgainstBaseline("pc");
                cs.Append(Pc.GetColorizedValueString(color));
                cs.Append(" psr=");
                color = GetColorForDiffAgainstBaseline("psr");
                cs.Append(Psr.GetColorizedValueString(color));

                // TODO:
                cs.AppendLine(" TBD: flags and mode");

                cs.Append(DbgProvider.ColorizeSymbol(StackFrame.SymbolName));
                if (0 != StackFrame.Displacement)
                {
                    cs.Append("+0x");
                    cs.Append(StackFrame.Displacement.ToString("x"));
                }
                cs.AppendLine(":");
                cs.Append(Disasm(Pc.ValueAsPointer));

                m_colorString = cs;
            }
            return(m_colorString);
        } // end ToString()