private coord tileSize;        // Size of a tile

        // Constructor
        public GridWidget(Game game, Cb callback, int scale) : base((uint)game.getSize().x, (uint)game.getSize().y, true)
        {
            this.callback = callback;
            this.clicked  = false;
            this.game     = game;
            this.tileSize = new coord(10 * scale, 10 * scale);
        }
Exemple #2
0
        public void Anular()
        {
            if (this.Existe && this.Anulado == false)
            {
                this.Estado = 90;

                // Marco el recibo como anulado
                qGen.Update Act = new qGen.Update(this.TablaDatos);
                Act.ColumnValues.AddWithValue("estado", this.Estado);
                Act.WhereClause = new qGen.Where(this.CampoId, this.Id);
                this.Connection.ExecuteNonQuery(Act);

                Lbl.Sys.Config.ActionLog(this.Connection, Lbl.Sys.Log.Acciones.Delete, this, null);

                if (this.DePago)
                {
                    foreach (Pago Pg in this.Pagos)
                    {
                        Pg.Anular();
                    }
                }
                else
                {
                    foreach (Cobro Cb in this.Cobros)
                    {
                        Cb.Anular();
                    }
                }

                DescancelarImpagos(this.Cliente, this.Facturas, this, this.DePago ? -this.Total : this.Total);
                this.Cliente.CuentaCorriente.Movimiento(true, this.Concepto, "Anulación de " + this.ToString(), this.DePago ? -this.Total : this.Total, this.Obs, null, this, null);
            }
        }
Exemple #3
0
 private void addSettings()
 {
     this.cbUseAutoBlanker   = new Cb("Use the autoblanker", this);
     this.cbStrictChecking   = new Cb("Use a strict check in play mode", this);
     this.cbDarkerBackground = new Cb("Use a grey theme instead of a white theme", this);
     this.cbOnlyStatusBar    = new Cb("Use only the statusbar, no popup messagese", this);
 }
Exemple #4
0
        private coord tileSize; // Size of a tile

        #endregion Fields

        #region Constructors

        // Constructor
        public GridWidget(Game game, Cb callback, int scale)
            : base((uint)game.getSize ().x, (uint)game.getSize ().y, true)
        {
            this.callback = callback;
              this.clicked = false;
              this.game = game;
              this.tileSize = new coord (10 * scale, 10 * scale);
        }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 public void RunComplete()
 {
     _timer?.Dispose();
     try
     {
         Cb?.Invoke(this);
     }
     catch
     {
     }
 }
Exemple #6
0
        public void CubedIntArrayTest()
        {
            int[] x = new int[f.Length];
            int[] y = Cb.Cubed(f);
            int   i = 0;

            foreach (int a in f)
            {
                x[i] = Cb.Cubed(a);
                Assert.AreEqual(x[i], y[i]);
                i++;
            }
        }
Exemple #7
0
        public void CubedDoubleArrayTest()
        {
            double[] x = new double[e.Length];
            double[] y = Cb.Cubed(e);
            int      i = 0;

            foreach (double a in e)
            {
                x[i] = Cb.Cubed(a);
                Assert.AreEqual(x[i], y[i]);
                i++;
            }
        }
        public override string ToString()
        {
            string Res = null;

            foreach (ComprobanteConArticulos Cb in this)
            {
                if (Res == null)
                {
                    Res = Cb.ToString();
                }
                else
                {
                    Res += System.Environment.NewLine + Cb.ToString();
                }
            }
            return(Res);
        }
Exemple #9
0
    public void SetResultFFF()  // It's also called 'Hon'  It has Target...
    {
        (" MdChubang :: SetResultFFF >>> " + mFff + ",  " + mLff).HtLog();
        int rval = ((int)mFff).DoCalculate((int)mLff, mGod);

        (" MdChubang :: rval >>> " + rval + ",  ").HtLog();
        mHff = (Fff)rval;

        if (mGod == Godirum.PLU)
        {
            mKind = Cb.PLUS_SIMPLE;
            if (rval >= 10)   // over 10 case ...
            {
                mKind = Cb.PLUS_OVER10;
                mHff  = (Fff)(rval - 10);
                return;
            }
        }
    }
        public void TestInitAndInvoke()
        {
            ChaincodeBase  cb = new Cb();
            ChaincodeInput ci = new ChaincodeInput();

            ci.Args.AddRange(new[] { ByteString.CopyFromUtf8("init"), ByteString.CopyFromUtf8("a"), ByteString.CopyFromUtf8("100") });
            ByteString       initPayload = ci.ToByteString();
            ChaincodeMessage initMsg     = MessageUtil.NewEventMessage(ChaincodeMessage.Types.Type.Init, "testChannel", "0", initPayload, null);

            List <IScenarioStep> scenario = new List <IScenarioStep>();

            scenario.Add(new RegisterStep());
            scenario.Add(new PutValueStep("100"));
            scenario.Add(new CompleteStep());
            scenario.Add(new GetValueStep("100"));
            scenario.Add(new PutValueStep("120"));
            scenario.Add(new DelValueStep());
            scenario.Add(new CompleteStep());
            server = ChaincodeMockPeer.StartServer(scenario);

            cb.Start(new string[] { "-a", "127.0.0.1:7052", "-i", "testId" });
            CheckScenarioStepEnded(server, 1, Timeout);

            server.Send(initMsg);
            CheckScenarioStepEnded(server, 3, Timeout);
            Assert.AreEqual(server.LastMessageSend.Type, ChaincodeMessage.Types.Type.Response);
            Assert.AreEqual(server.LastMessageRcvd.Type, ChaincodeMessage.Types.Type.Completed);
            Assert.AreEqual(Protos.Peer.ProposalResponsePackage.Response.Parser.ParseFrom(server.LastMessageRcvd.Payload).Message, "OK response1");
            ci = new ChaincodeInput();
            ci.Args.AddRange(new[] { ByteString.CopyFromUtf8("invoke"), ByteString.CopyFromUtf8("a"), ByteString.CopyFromUtf8("10") });
            ByteString       invokePayload = ci.ToByteString();
            ChaincodeMessage invokeMsg     = MessageUtil.NewEventMessage(ChaincodeMessage.Types.Type.Transaction, "testChannel", "0", invokePayload, null);

            server.Send(invokeMsg);

            CheckScenarioStepEnded(server, 7, Timeout);
            Assert.AreEqual(server.LastMessageSend.Type, ChaincodeMessage.Types.Type.Response);
            Assert.AreEqual(server.LastMessageRcvd.Type, ChaincodeMessage.Types.Type.Completed);
            Assert.AreEqual(Protos.Peer.ProposalResponsePackage.Response.Parser.ParseFrom(server.LastMessageRcvd.Payload).Message, "OK response2");
        }
Exemple #11
0
    // It's also called 'Hon'  It has Target...
    public void SetResultFFF()
    {
        (" MdChubang :: SetResultFFF >>> " + mFff + ",  " + mLff).HtLog ();
        int rval = ((int)mFff).DoCalculate((int)mLff, mGod);
        (" MdChubang :: rval >>> " + rval + ",  " ).HtLog ();
        mHff = (Fff)rval;

        if (mGod == Godirum.PLU) {
            mKind = Cb.PLUS_SIMPLE;
            if (rval >= 10) { // over 10 case ...
                mKind = Cb.PLUS_OVER10;
                mHff = (Fff)(rval - 10);
                return;
            }
        }
    }
Exemple #12
0
 /// <summary>
 /// Returns a System.String object that represents the current object.
 /// </summary>
 /// <returns>Text as a sequence of Unicode characters</returns>
 public override string ToString()
 {
     return(Y.ToString() + "\n" + Cb.ToString() + "\n" + Cr.ToString());
 }
Exemple #13
0
        private void MostrarValores()
        {
            ListaValores.BeginUpdate();
            ListaValores.Items.Clear();
            Lbl.Comprobantes.Recibo Rec = this.Elemento as Lbl.Comprobantes.Recibo;

            if (this.DePago)
            {
                foreach (Lbl.Comprobantes.Pago Pg in Rec.Pagos)
                {
                    ListViewItem itm = ListaValores.Items.Add(Pg.GetHashCode().ToString());
                    switch (Pg.FormaDePago.Tipo)
                    {
                    case Lbl.Pagos.TiposFormasDePago.Efectivo:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Pg.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Pg.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        break;

                    case Lbl.Pagos.TiposFormasDePago.Caja:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Pg.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Pg.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, "Débito desde " + Pg.CajaOrigen.ToString()));
                        break;

                    default:
                        itm.SubItems.Add(Pg.FormaDePago.ToString());
                        itm.SubItems.Add(Lfx.Types.Formatting.FormatCurrency(Pg.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales));
                        itm.SubItems.Add(Pg.ToString());
                        break;
                    }
                }
                EtiquetaValoresImporte.Text = Lfx.Types.Formatting.FormatCurrency(Rec.Pagos.ImporteTotal, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales);
            }
            else
            {
                foreach (Lbl.Comprobantes.Cobro Cb in Rec.Cobros)
                {
                    ListViewItem itm = ListaValores.Items.Add(Cb.GetHashCode().ToString());
                    switch (Cb.FormaDePago.Tipo)
                    {
                    case Lbl.Pagos.TiposFormasDePago.Efectivo:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Cb.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Cb.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        break;

                    case Lbl.Pagos.TiposFormasDePago.Tarjeta:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Cb.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Cb.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, "Cupón Nº " + Cb.Cupon.Numero + " de " + Cb.Cupon.FormaDePago.ToString()));
                        break;

                    case Lbl.Pagos.TiposFormasDePago.Caja:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Cb.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Cb.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, "Depósito en " + Cb.CajaDestino.ToString()));
                        break;

                    default:
                        itm.SubItems.Add(Cb.FormaDePago.ToString());
                        itm.SubItems.Add(Lfx.Types.Formatting.FormatCurrency(Cb.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales));
                        itm.SubItems.Add(Cb.ToString());
                        break;
                    }
                }
                EtiquetaValoresImporte.Text = Lfx.Types.Formatting.FormatCurrency(Rec.Cobros.ImporteTotal, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales);
            }

            LabelAgregarValores.Visible = ListaValores.Items.Count == 0 && this.Elemento.Existe == false;
            BotonQuitarValor.Visible    = ListaValores.Items.Count > 0;

            if (ListaValores.Items.Count > 0 && ListaValores.SelectedItems.Count == 0)
            {
                ListaValores.Items[ListaValores.Items.Count - 1].Selected = true;
                ListaValores.Items[ListaValores.Items.Count - 1].Focused  = true;
            }

            ListaValores.EndUpdate();
        }
Exemple #14
0
 public override int GetHashCode()
 {
     return(Y.GetHashCode() ^ Cb.GetHashCode() ^ Cr.GetHashCode());
 }
Exemple #15
0
 public dynamic Cubed(dynamic a)
 {
     result = Cb.Cubed(a);
     return(result);
 }
        public Bitmap[] load(Stream stream)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            if (binaryReader.ReadChar() != id)
            {
                //
            }

            width  = binaryReader.ReadInt32();
            height = binaryReader.ReadInt32();

            //intra frame
            int count = binaryReader.ReadInt32();

            YEncode = new List <byte>(binaryReader.ReadBytes(count));

            count    = binaryReader.ReadInt32();
            CbEncode = new List <byte>(binaryReader.ReadBytes(count));

            count    = binaryReader.ReadInt32();
            CrEncode = new List <byte>(binaryReader.ReadBytes(count));

            //inter frame
            count         = binaryReader.ReadInt32();
            YEncodeInter  = new List <byte>(binaryReader.ReadBytes(count));
            count         = binaryReader.ReadInt32();
            CbEncodeInter = new List <byte>(binaryReader.ReadBytes(count));
            count         = binaryReader.ReadInt32();
            CrEncodeInter = new List <byte>(binaryReader.ReadBytes(count));

            //motion vector
            int x = binaryReader.ReadInt32();
            int y = binaryReader.ReadInt32();

            YMoVec = new Point[x, y];
            for (int i = 0; i < x; i++)
            {
                for (int j = 0; j < y; j++)
                {
                    YMoVec[i, j].X = binaryReader.ReadSByte();
                    YMoVec[i, j].Y = binaryReader.ReadSByte();
                }
            }

            x       = binaryReader.ReadInt32();
            y       = binaryReader.ReadInt32();
            CbMoVec = new Point[x, y];
            for (int i = 0; i < x; i++)
            {
                for (int j = 0; j < y; j++)
                {
                    CbMoVec[i, j].X = binaryReader.ReadSByte();
                    CbMoVec[i, j].Y = binaryReader.ReadSByte();
                }
            }

            x       = binaryReader.ReadInt32();
            y       = binaryReader.ReadInt32();
            CrMoVec = new Point[x, y];
            for (int i = 0; i < x; i++)
            {
                for (int j = 0; j < y; j++)
                {
                    CrMoVec[i, j].X = binaryReader.ReadSByte();
                    CrMoVec[i, j].Y = binaryReader.ReadSByte();
                }
            }



            Bitmap[] ret = new Bitmap[2];

            ret[0] = new Bitmap(width, height);
            ret[1] = new Bitmap(width, height);

            //decode intra frame
            YQuant  = decoding(YEncode, width, height);
            CbQuant = decoding(CbEncode, width / 2, height / 2);
            CrQuant = decoding(CrEncode, width / 2, height / 2);

            YDCT  = invQuantization(YQuant);
            CbDCT = invQuantization(CbQuant);
            CrDCT = invQuantization(CrQuant);

            Y  = inverseDCT(YDCT, width, height);
            Cb = inverseDCT(CbDCT, Cb.GetLength(0), Cb.GetLength(1));
            Cr = inverseDCT(CrDCT, Cr.GetLength(0), Cr.GetLength(1));


            unsubSampling(ref Cb, ref Cr);
            YCbCrtoRGB(ret[0], Y, Cb, Cr);

            //decode inter frame
            subSampling(ref Cb, ref Cr);
            YQuantInter  = decoding(YEncodeInter, width, height);
            CbQuantInter = decoding(CbEncodeInter, width / 2, height / 2);
            CrQuantInter = decoding(CrEncodeInter, width / 2, height / 2);

            YDCTInter  = invQuantization(YQuantInter);
            CbDCTInter = invQuantization(CbQuantInter);
            CrDCTInter = invQuantization(CrQuantInter);

            YDif  = inverseDCTInter(YDCTInter, width, height);
            CbDif = inverseDCTInter(CbDCTInter, CbInter.GetLength(0), CbInter.GetLength(1));
            CrDif = inverseDCTInter(CrDCTInter, CrInter.GetLength(0), CrInter.GetLength(1));

            YInter  = unCalcDifference(Y, YMoVec, YDif);
            CbInter = unCalcDifference(Cb, CbMoVec, CbDif);
            CrInter = unCalcDifference(Cr, CrMoVec, CrDif);

            unsubSampling(ref CbInter, ref CrInter);
            YCbCrtoRGB(ret[1], YInter, CbInter, CrInter);


            return(ret);
        }
Exemple #17
0
 public void CubedDoubleTest()
 {
     Assert.AreEqual(421.875, Cb.Cubed(c));
 }
Exemple #18
0
 public void CubedTest()
 {
     Assert.AreEqual(3375, Cb.Cubed(a));
 }