Ejemplo n.º 1
0
        public void ShouldEvaluateDeltaValue()
        {
            EvaluatorContext context = new EvaluatorContext();

            FakeConsoleRam ram = new FakeConsoleRam(0xFF);

            ram.Data[4] = 4;

            // 0xH0004 < d0xH004
            ReadMemoryValue readMemory = new ReadMemoryValue
            {
                Address = 0x0004,
                Kind    = MemoryAddressKind.Int8
            };

            DeltaValue deltaValue = new DeltaValue(readMemory);

            CompareInstruction compareInst = new CompareInstruction
            {
                Left      = readMemory,
                Right     = deltaValue,
                Operation = ConditionCompare.Less
            };

            Assert.False(compareInst.Evaluate(ram, context));

            ram.Data[4] = 2;

            Assert.True(compareInst.Evaluate(ram, context));
            Assert.False(compareInst.Evaluate(ram, context));
        }
Ejemplo n.º 2
0
        protected override void GomOnBarUpdateDone()
        {
            dsClose.Set(totalvolume);
            dsHigh.Set(hi);
            dsLow.Set(lo);

            DeltaValue.Set(totalvolume);
        }
        // Handles the DashboardViewer.DashboardItemClick event.
        private void dashboardViewer1_DashboardItemClick(object sender,
                                                         DashboardItemMouseActionEventArgs e)
        {
            if (e.DashboardItemName == "cardDashboardItem1" & e.GetAxisPoint() != null)
            {
                // Obtains client data related to the clicked card.
                MultiDimensionalData clickedItemData = e.Data.GetSlice(e.GetAxisPoint());
                DeltaDescriptor      delta           = e.GetDeltas()[0];

                // Creates a data table that will be used to hold client data.
                DataTable dataSource = new DataTable();
                dataSource.Columns.Add("Argument", typeof(DateTime));
                dataSource.Columns.Add("Actual", typeof(double));
                dataSource.Columns.Add("Target", typeof(double));

                // Saves values of axis points placed on the "sparkline" axis and corresponding
                // actual/target values to the data table.
                foreach (AxisPoint point in
                         clickedItemData.GetAxisPoints(DashboardDataAxisNames.SparklineAxis))
                {
                    DataRow    row        = dataSource.NewRow();
                    DeltaValue deltaValue = clickedItemData.GetSlice(point).GetDeltaValue(delta);
                    if (deltaValue.ActualValue.Value != null &&
                        deltaValue.TargetValue.Value != null)
                    {
                        row["Argument"] = point.Value;
                        row["Actual"]   = deltaValue.ActualValue.Value;
                        row["Target"]   = deltaValue.TargetValue.Value;
                    }
                    else
                    {
                        row["Argument"] = DBNull.Value;
                        row["Actual"]   = DBNull.Value;
                        row["Target"]   = DBNull.Value;
                    }
                    dataSource.Rows.Add(row);
                }
                DisplayDetailedChart(GetFormTitle(clickedItemData), dataSource);
            }
        }