Ejemplo n.º 1
0
        public void gettieudegau(string tungay, string denngay, string makhuyenmai)
        {
            xrLabel5.Text = "BÁO CÁO ĐỐI CHIẾU CHIẾT KHẤU GẤU ĐỎ";
            xrLabel1.Text = gen.GetString("select Top 1 CompanyName from Center");
            xrLabel2.Text = gen.GetString("select Top 1 Address from Center");
            xrLabel6.Text = "MÃ KHUYẾN MÃI - " + makhuyenmai.ToUpper();

            xrLabel4.Text = "In lúc: " + String.Format("{0:HH:mm:ss}", DateTime.Now) + " ngày: " + String.Format("{0:dd-MM-yyyy}", DateTime.Now);

            DataTable da = new DataTable();

            da = gen.GetTable("select Substring(RefNo,7,9) as 'Số phiếu',RefDate as 'Ngày lập',REPLACE(InvoiceNo,'UNI','') as 'Đơn hàng',case when FreeCode='" + makhuyenmai + "' then sotien end as 'Số tiền',case when FreeCode<>'" + makhuyenmai + "' then sotien end as 'Tiền khác', case when FreeCode<>'" + makhuyenmai + "' then FreeCode end 'Chương trình khác',tongtien as 'Tổng tiền',chietkhau as 'Chiết khấu',Case when tongtien-chietkhau<>0 then tongtien-chietkhau end as 'Chênh lệch' from (select a.InvoiceNo,FreeCode,sotien,tongtien from (select a.InvoiceNo,FreeCode,SUM(Amount) as sotien from (select * from INOutwardCheck where Amount<>0) a, (select distinct InvoiceNo  from INOutwardCheck where FreeCode='" + makhuyenmai + "') b where a.InvoiceNo=b.InvoiceNo group by a.InvoiceNo,FreeCode) a,(select a.InvoiceNo,SUM(Amount) as tongtien from (select * from INOutwardCheck where Amount<>0) a, (select distinct InvoiceNo  from INOutwardCheck where FreeCode='" + makhuyenmai + "') b where a.InvoiceNo=b.InvoiceNo group by a.InvoiceNo) b where a.InvoiceNo=b.InvoiceNo) a,(select RefNo,RefDate,JournalMemo,Round(TotalFreightAmount/1.1,0) as chietkhau from INOutward) b where a.InvoiceNo=b.JournalMemo order by RefNo,RefDate,[Số tiền] DESC");

            DataSource = da;

            XRSummary summarytotal  = new XRSummary();
            XRSummary summarytotal1 = new XRSummary();
            XRSummary summarytotal2 = new XRSummary();
            XRSummary summarytotal3 = new XRSummary();
            XRSummary summarytotal4 = new XRSummary();
            XRSummary summarytotal5 = new XRSummary();

            Bands.Add(GroupHeader1);
            GroupField groupField = new GroupField("Đơn hàng");

            GroupHeader1.GroupFields.Add(groupField);
            xrTableCell10.DataBindings.Add("Text", DataSource, "Đơn hàng");
            xrTableCell9.DataBindings.Add("Text", DataSource, "Ngày lập", "{0:dd/MM/yy}");
            xrTableCell8.DataBindings.Add("Text", DataSource, "Số phiếu");
            xrTableCell15.DataBindings.Add("Text", DataSource, "Chiết khấu", "{0:n0}");
            xrTableCell18.DataBindings.Add("Text", DataSource, "Chênh lệch", "{0:n0}");

            summarytotal.Running          = SummaryRunning.Group;
            summarytotal.IgnoreNullValues = true;
            summarytotal.FormatString     = "{0:n0}";
            xrTableCell11.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}");
            xrTableCell11.Summary = summarytotal;

            summarytotal1.Running          = SummaryRunning.Group;
            summarytotal1.IgnoreNullValues = true;
            summarytotal1.FormatString     = "{0:n0}";
            xrTableCell12.DataBindings.Add("Text", DataSource, "Tiền khác", "{0:n0}");
            xrTableCell12.Summary = summarytotal1;

            summarytotal4.Running          = SummaryRunning.Report;
            summarytotal4.IgnoreNullValues = true;
            summarytotal4.FormatString     = "{0:n0}";
            xrTableCell20.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}");
            xrTableCell20.Summary = summarytotal4;

            summarytotal5.Running          = SummaryRunning.Report;
            summarytotal5.IgnoreNullValues = true;
            summarytotal5.FormatString     = "{0:n0}";
            xrTableCell21.DataBindings.Add("Text", DataSource, "Tiền khác", "{0:n0}");
            xrTableCell21.Summary = summarytotal5;

            xrTableCell22.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}");
            xrTableCell24.DataBindings.Add("Text", DataSource, "Tiền khác", "{0:n0}");
            xrTableCell26.DataBindings.Add("Text", DataSource, "Chương trình khác");
        }
Ejemplo n.º 2
0
 private void InitializeComponent()
 {
     topMarginBand1    = new TopMarginBand();
     detailBand1       = new DetailBand();
     bottomMarginBand1 = new BottomMarginBand();
     xrLabel1          = new XRLabel();
     ((ISupportInitialize)this).BeginInit();
     topMarginBand1.Name = "topMarginBand1";
     detailBand1.Controls.AddRange(new XRControl[]
     {
         xrLabel1
     });
     detailBand1.Name       = "detailBand1";
     bottomMarginBand1.Name = "bottomMarginBand1";
     xrLabel1.LocationFloat = new PointFloat(36.45833F, 22.91667F);
     xrLabel1.Name          = "xrLabel1";
     xrLabel1.Padding       = new PaddingInfo(2, 2, 0, 0, 96F);
     xrLabel1.SizeF         = new SizeF(354.1667F, 56.25F);
     xrLabel1.Text          = "xrLabel1";
     Bands.AddRange(new Band[]
     {
         topMarginBand1,
         detailBand1,
         bottomMarginBand1
     });
     Version = "14.1";
     ((ISupportInitialize)this).EndInit();
 }
 private void GetBands()
 {
     try
     {
         FacebookContext context = new FacebookContext();
         context.Load <Band>(context.GetBandsQuery(AccessToken),
                             (loadOp) =>
         {
             if (!loadOp.HasError)
             {
                 Bands.Clear();
                 foreach (Band band in loadOp.Entities)
                 {
                     Bands.Add(band);
                 }
             }
             else
             {
                 MessageBox.Show(loadOp.Error.ToString());
             }
         },
                             null);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Ejemplo n.º 4
0
        public void BindDataSum(DataTable da)
        {
            xrTable4.Visible = false;
            DataSource       = da;

            Bands.Add(GroupHeader1);
            GroupField groupField = new GroupField("Số phiếu");

            GroupHeader1.GroupFields.Add(groupField);
            xrTableCell1.DataBindings.Add("Text", DataSource, "Số phiếu");
            xrTableCell2.DataBindings.Add("Text", DataSource, "Ngày", "{0:dd-MM-yyyy}");
            xrTableCell3.DataBindings.Add("Text", DataSource, "Lý do");
            xrTableCell4.DataBindings.Add("Text", DataSource, "Nhân viên");


            XRSummary summarytotal  = new XRSummary();
            XRSummary summarytotal1 = new XRSummary();

            summarytotal.Running          = SummaryRunning.Group;
            summarytotal.IgnoreNullValues = true;
            summarytotal.FormatString     = "{0:n0}";
            xrTableCell20.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}");
            xrTableCell20.Summary = summarytotal;

            summarytotal1.Running          = SummaryRunning.Report;
            summarytotal1.IgnoreNullValues = true;
            summarytotal1.FormatString     = "{0:n0}";
            xrTableCell19.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}");
            xrTableCell19.Summary = summarytotal1;

            xrTableCell7.DataBindings.Add("Text", DataSource, "Tài khoản nợ");
            xrTableCell10.DataBindings.Add("Text", DataSource, "Tài khoản có");
            xrTableCell11.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}");
        }
Ejemplo n.º 5
0
        public List <Bands> SetEqualizer(int preset)
        {
            var result = new List <Bands>();

            if (mediaPlayer == null)
            {
                return(result);
            }
            else
            {
                equalizer.UsePreset((short)preset);
                int numberFrequencyBands = equalizer.NumberOfBands;
                //string lowerEqualizerBandLevel = equalizer.GetBandLevelRange()[0] / 100 + "dB";
                short lowerEqualizer          = equalizer.GetBandLevelRange()[0];
                short upperEqualizerBandLevel = equalizer.GetBandLevelRange()[1];
                //string upperEqualizerBandLevel = equalizer.GetBandLevelRange()[1] / 100 + "dB";
                int maxValue = (upperEqualizerBandLevel - lowerEqualizer);
                for (short i = 0; i < numberFrequencyBands; i++)
                {
                    short  equalizerBandIndex = i;
                    string setFrequency       = equalizer.GetCenterFreq(equalizerBandIndex) / 1000 + "Hz"; //// 60-14000Hz
                    Console.WriteLine(equalizerBandIndex);
                    int   value = equalizer.GetBandLevel(equalizerBandIndex) - lowerEqualizer;             // init value
                    Bands bands = new Bands(setFrequency, equalizerBandIndex, value, maxValue);
                    result.Add(bands);
                }
                return(result);
            }
        }
Ejemplo n.º 6
0
 public ChannelParams()
 {
     this.Id              = 0;
     this.frequency       = 0U;
     this.dataRange.Value = (sbyte)0;
     this.band            = Bands.BAND_G1_0;
 }
Ejemplo n.º 7
0
 public imageHandler(Bitmap Image, Point StartPoint, Point EndPoint, Bands Lines)
 {
     image      = Image;
     startPoint = StartPoint;
     endPoint   = EndPoint;
     lines      = Lines;
 }
Ejemplo n.º 8
0
 public BandSetting this[BAND band]
 {
     get
     {
         DataRow row = this.Rows.Find(Bands.GetStringValue(band));
         if (row != null)
         {
             BandSetting setting = new BandSetting();
             try
             {
                 // fill in the values from the bandsettings table
                 setting.K_Factor        = (double)row["K-FACTOR"];
                 setting.F1_Clearance    = (double)row["F1-CLEARANCE"];
                 setting.GroundClearance = (double)row["GROUNDCLEARANCE"];
                 setting.MaxDistance     = (double)row["MAXDISTANCE"];
                 setting.MaxSquint       = (double)row["MAXSQUINT"];
                 setting.MaxElevation    = (double)row["MAXELEVATION"];
             }
             catch
             {
             }
             return(setting);
         }
         else
         {
             BandSetting setting = new BandSetting();
             return(setting);
         }
     }
 }
Ejemplo n.º 9
0
        public string GetColumnsBooleanTexts(string booleanName)
        {
            var ret = "";

            switch (booleanName)
            {
            case "IsChartSeries":
                Columns.FindAll(x => !x.IsToDelete && x.IsChartSeries).ForEach(col => ret += ", " + col.FullPath);
                break;

            case "IsMapDiagramSeries":
                Columns.FindAll(x => !x.IsToDelete && x.IsMapDiagramSeries).ForEach(col => ret += ", " + col.FullPath);
                break;

            case "IsMapGradientSeries":
                Columns.FindAll(x => !x.IsToDelete && x.IsMapGradientSeries).ForEach(col => ret += ", " + col.FullPath);
                break;
            }

            Bands.FindAll(x => !x.IsToDelete).ForEach(b =>
            {
                var s = b.GetColumnsBooleanTexts(booleanName);
                if (s.Length > 0)
                {
                    ret += ", " + s;
                }
            });
            return(ret.Length > 2 ? ret.Substring(2).Trim() : "");
        }
        // GET: Artists/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //getting the artist
            Artists art = db.Artists.SqlQuery("select * from Artists where artistid = @id", new SqlParameter("id", id)).FirstOrDefault();

            if (art == null)
            {
                return(HttpNotFound());
            }
            //getting the band
            Bands band = db.Bands.SqlQuery("select * from Bands where bandid = @id", new SqlParameter("id", art.bandid)).FirstOrDefault();
            //getting the instruments this artist plays
            string query = "select Instruments.* from Instruments inner join InstrumentsArtists on Instruments.instrumentid=InstrumentsArtists.Instruments_instrumentid " +
                           " where InstrumentsArtists.Artists_artistid=" + art.artistid;
            List <Instruments> instruments = db.Instruments.SqlQuery(query).ToList();

            Debug.WriteLine("Instrument List = " + instruments.ToString());
            art.Instruments = instruments;
            ArtistDetails viewmodel = new ArtistDetails();

            viewmodel.artist = art;
            viewmodel.band   = band;

            return(View(viewmodel));
        }
Ejemplo n.º 11
0
        public void BindDatakm(DataTable da)
        {
            DataSource = da;

            Bands.Add(GroupHeader1);
            GroupField groupField1 = new GroupField("Mã hàng");

            GroupHeader1.GroupFields.Add(groupField1);


            xrTableCell1.DataBindings.Add("Text", DataSource, "Mã hàng");
            xrTableCell3.DataBindings.Add("Text", DataSource, "Tên hàng");

            xrTableCell4.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}");
            XRSummary summary = new XRSummary();

            summary.Running          = SummaryRunning.Group;
            summary.IgnoreNullValues = true;
            summary.FormatString     = "{0:n0}";
            xrTableCell4.Summary     = summary;

            xrTableCell5.DataBindings.Add("Text", DataSource, "Trọng lượng", "{0:n2}");
            XRSummary summary1 = new XRSummary();

            summary1.Running          = SummaryRunning.Group;
            summary1.IgnoreNullValues = true;
            summary1.FormatString     = "{0:n2}";
            xrTableCell5.Summary      = summary1;



            XRSummary summarytotal  = new XRSummary();
            XRSummary summarytotal1 = new XRSummary();
            XRSummary summarytotal3 = new XRSummary();
            XRSummary summarytotal4 = new XRSummary();
            XRSummary summarytotal5 = new XRSummary();
            XRSummary summarytotal6 = new XRSummary();
            XRSummary summarytotal7 = new XRSummary();
            XRSummary summarytotal8 = new XRSummary();


            summarytotal.Running          = SummaryRunning.Report;
            summarytotal.IgnoreNullValues = true;
            summarytotal.FormatString     = "{0:n0}";
            xrTableCell22.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}");
            xrTableCell22.Summary = summarytotal;

            summarytotal1.Running          = SummaryRunning.Report;
            summarytotal1.IgnoreNullValues = true;
            summarytotal1.FormatString     = "{0:n2}";
            xrTableCell23.DataBindings.Add("Text", DataSource, "Trọng lượng", "{0:n2}");
            xrTableCell23.Summary = summarytotal1;


            xrTableCell16.DataBindings.Add("Text", DataSource, "Ngày lập", "{0:dd-MM-yyyy}");
            xrTableCell11.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}");
            xrTableCell12.DataBindings.Add("Text", DataSource, "Trọng lượng", "{0:n2}");
            xrTableCell6.DataBindings.Add("Text", DataSource, "Phiếu");
            xrTableCell10.DataBindings.Add("Text", DataSource, "Tên khách");
        }
        // GET: Artists/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //grabbing the artist
            Artists art = db.Artists.SqlQuery("select * from Artists where artistid = @id", new SqlParameter("id", id)).FirstOrDefault();

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

            //grabbing the band the artists is currently in (so it can be "selected" in the drop down menu)
            Bands currBand = db.Bands.SqlQuery("select * from Bands where bandid = @id", new SqlParameter("id", art.bandid)).FirstOrDefault();;

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

            //grabbing all bands
            string       query    = "select * from bands";
            List <Bands> allBands = db.Bands.SqlQuery(query).ToList();

            //create instance of our viewmodel
            showArtist viewmodel = new showArtist();

            viewmodel.artist      = art;
            viewmodel.currentBand = currBand;
            viewmodel.allBands    = allBands;

            return(View(viewmodel));
        }
Ejemplo n.º 13
0
        public ActionResult Create()
        {
            Band newBands = new Bands(Request.Form["bandsName"]);

            newBands.Save();
            return(RedirectToAction("Success", "Home"));
        }
        /// <summary>
        /// Process mono dsp chain.
        /// </summary>
        /// <param name="samples">Array of 16bit samples.</param>
        private void _ProcessDSPMono(ref Int16[] samples)
        {
            int len = samples.Length;
            int i   = 0;

            unsafe
            {
                do
                {
                    Bands.BiQuad(ref samples[i], Biquad100Left);
                    Bands.BiQuad(ref samples[i], Biquad200Left);
                    Bands.BiQuad(ref samples[i], Biquad400Left);
                    Bands.BiQuad(ref samples[i], Biquad800Left);
                    Bands.BiQuad(ref samples[i], Biquad1600Left);
                    Bands.BiQuad(ref samples[i], Biquad3200Left);
                    Bands.BiQuad(ref samples[i], Biquad6400Left);

                    Bands.BiQuad(ref samples[i], BiquadHPF);

                    Bands.BiQuad(ref samples[i], BiquadLPF);

                    i++;
                } while (i < len);
            }
        }
Ejemplo n.º 15
0
		public ChannelParams()
		{
			this.Id = 0;
			this.frequency = 0U;
			this.dataRange.Value = (sbyte)0;
			this.band = Bands.BAND_G1_0;
		}
Ejemplo n.º 16
0
        /// <summary>
        /// Process mono dsp chain.
        /// </summary>
        /// <param name="samples">Array of 8bit samples.</param>
        private void _ProcessDSPMono(ref byte[] buffer)
        {
            int len = buffer.Length;
            int i   = 0;

            unsafe
            {
                do
                {
                    Bands.BiQuad(ref buffer[i], Biquad100Left);
                    Bands.BiQuad(ref buffer[i], Biquad200Left);
                    Bands.BiQuad(ref buffer[i], Biquad400Left);
                    Bands.BiQuad(ref buffer[i], Biquad800Left);
                    Bands.BiQuad(ref buffer[i], Biquad1600Left);
                    Bands.BiQuad(ref buffer[i], Biquad3200Left);
                    Bands.BiQuad(ref buffer[i], Biquad6400Left);

                    Bands.BiQuad(ref buffer[i], BiquadHPF);

                    Bands.BiQuad(ref buffer[i], BiquadLPF);

                    i++;
                } while (i < len);
            }
        }
Ejemplo n.º 17
0
        public void Equals_OverrideTrueForSameDescription_Book()
        {
            BandTracker bands1 = new Bands("BandOne", "Pop");
            BandTracker bands2 = new Bands("BandTwo", "Latin");

            Assert.AreEqual(bands1, bands2)
        }
Ejemplo n.º 18
0
        public void AddMarginBands()
        {
            // Check if the TopMargin band already presents in the report.
            if (Bands.GetBandByType(typeof(TopMarginBand)) == null)
            {
                // Create a new TopMargin band and add it to the report.
                TopMarginBand tmBand = new TopMarginBand();
                Bands.Add(tmBand);

                // Create a label and set its text and width.
                XRLabel label = new XRLabel();
                label.Text  = "TopMargin Band";
                label.Width = 200;

                // Add the label to the TopMargin band.
                tmBand.Controls.Add(label);
            }

            // Check if the BottomMargin band already presents in the report.
            if (Bands.GetBandByType(typeof(BottomMarginBand)) == null)
            {
                // Create a new BottomMargin band and add it to the report.
                BottomMarginBand bmBand = new BottomMarginBand();
                Bands.Add(bmBand);

                // Create an XRPageInfo object and set its width and PageInfo option.
                XRPageInfo datePageInfo = new XRPageInfo();
                datePageInfo.Width    = 200;
                datePageInfo.PageInfo = PageInfo.DateTime;

                // Add the page information control to the BottomMargin band.
                bmBand.Controls.Add(datePageInfo);
            }
        }
Ejemplo n.º 19
0
        public virtual bool IsDiffFromPivot()
        {
            if (Bands.Any(band => band.IsDiffFromPivot()))
            {
                return(true);
            }

            foreach (var column in Columns)
            {
                if (column.IsAggregate)
                {
                    if (!column.IsToDelete)
                    {
                        return(true);
                    }
                }
                else
                {
                    if (column.IsDiffFromPivot())
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 20
0
        public override void Init(bool setToDefaultValues = false)
        {
            FSystem.LockDsp();
            Bands.Clear();

            var gainValues = !setToDefaultValues && EqualizerSettings != null ? EqualizerSettings.GainValues : null;

            foreach (var value in EqDefaultValues)
            {
                var band = GetEqualizerBand(IsEnabled, value[0], value[1], value[2]);

                if (band == null)
                {
                    continue;
                }
                ((FmodEqualizerBand)band).PropertyChanged += (sender, e) =>
                {
                    if (e.PropertyName == "Gain")
                    {
                        SaveEqualizerSettings();
                    }
                };

                if (gainValues != null && gainValues.TryGetValue(band.BandCaption, out float savedValue))
                {
                    band.Gain = savedValue;
                }
                Bands.Add(band);
            }
            FSystem.UnlockDsp();
        }
Ejemplo n.º 21
0
        public bool Delete()
        {
            //delete all child columns and bands
            for (var i = 0; i < Columns.Count; i++)
            {
                if (!Columns[i].Delete())
                {
                    Columns.RemoveAt(i--);
                }
            }

            for (var j = 0; j < Bands.Count; j++)
            {
                if (!Bands[j].Delete())
                {
                    Bands.RemoveAt(j--);
                }
            }

            if (m_ID <= 0)
            {
                return(false);
            }

            m_ToDelete = true;
            return(true);
        }
        public async Task SearchBandAsync()
        {
            var caller = $"{nameof(SearchBandViewModel)}({_instanceId:N}).{nameof(SearchBandAsync)}";
            var debug  = new Action <string>(x => Logger.Log.Debug(x, caller));

            if (string.IsNullOrWhiteSpace(BandNameToSearch))
            {
                return;
            }

            try
            {
                BusyStatus = "Searching ...";
                IsBusy     = true;
                Bands.Clear();
                var searchBand = await DataService.SearchBandAsync(BandNameToSearch);

                debug($"No. of bands found: {searchBand?.Data?.SearchResults?.Count ?? 0}");
                (searchBand?.Data?.SearchResults ?? new List <Band>()).ForEach(Bands.Add);
                (searchBand as BaseResponse).To(this as BaseViewModel);
                IsBusy = false;
            }
            catch (Exception ex)
            {
                var errorId = Invariant($"{DateTime.Now:yyyyMMdd_HHmmss}");
                Logger.Log.Error(ex, "Failed to search by band name.", caller, errorId);
                IsBusy = false;
                MessageBoxService.ShowMessage($"Failed to search by band name.{Environment.NewLine}{ex.Message}{Environment.NewLine}See log for more info. Error id is {errorId}.", WindowTitle, MessageButton.OK, MessageIcon.Error);
            }
        }
Ejemplo n.º 23
0
 public override void Dispose()
 {
     DeInit();
     Bands.Clear();
     _handle = -1;
     _fxEq   = -1;
 }
        public async Task <IActionResult> Edit(int id, [Bind("BandId,CategoryId,BandName")] Bands bands)
        {
            if (id != bands.BandId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bands);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BandsExists(bands.BandId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bands));
        }
Ejemplo n.º 25
0
        public void BandBColorCodeTableLookupTest([ValueSource(typeof(OhnValueCalculatorTestData), "Colors")] ColorCodes x,
                                                  [ValueSourceAttribute(typeof(OhnValueCalculatorTestData), "BandBColumn")] Bands position,
                                                  [ValueSource(typeof(OhnValueCalculatorTestData), "BandBResults")] double ohm)
        {
            IOhmValueCalculator instance = CreateInstance();

            if (ohm >= 0)
            {
                var sutOhms = instance.TableLookup(x, position);
                Assert.AreEqual(sutOhms, ohm);
            }

            else
            {
                try
                {
                    var sutOhmsInvalid = instance.TableLookup(x, position);
                    Assert.AreEqual(true, false); //ohm < 0 denotes invalid table values, so it should not pass
                }
                catch
                {
                    Assert.AreEqual(true, true);//instead exception should occur
                }
            }
        }
Ejemplo n.º 26
0
 private void bw_Horizon_Calculate_DoWork(object sender, DoWorkEventArgs e)
 {
     // name the thread for debugging
     if (String.IsNullOrEmpty(Thread.CurrentThread.Name))
     {
         Thread.CurrentThread.Name = Name + "_" + this.GetType().Name;
     }
     try
     {
         Stopwatch st = new Stopwatch();
         st.Start();
         // clear all diagrams
         ClearAllDiagrams();
         PropagationHorizonDesignator hd = PropagationData.Database.PropagationHorizonFindOrCreate(
             bw_Horizon_Calculate,
             Location.Lat,
             Location.Lon,
             Elevation + AntennaHeight,
             CalculationDistance,
             Bands.ToGHz(Properties.Settings.Default.Band),
             LatLon.Earth.Radius * Properties.Settings.Default.Path_Band_Settings[Properties.Settings.Default.Band].K_Factor,
             Properties.Settings.Default.Path_Band_Settings[Properties.Settings.Default.Band].F1_Clearance,
             ElevationData.Database.GetDefaultStepWidth(Properties.Settings.Default.ElevationModel),
             Properties.Settings.Default.ElevationModel, LocalObstruction);
         st.Stop();
         bw_Horizon_Calculate.ReportProgress(-1, "Calculation of radio horizon of " + Location.Call + " finished, " + st.ElapsedMilliseconds + "ms.");
         // report complete horizon to main thread
         bw_Horizon_Calculate.ReportProgress(360, hd);
     }
     catch (Exception ex)
     {
         bw_Horizon_Calculate.ReportProgress(-1, ex.ToString());
     }
 }
Ejemplo n.º 27
0
 public ChannelParams(int id, uint frequency, Datarates min, Datarates max, Bands band)
 {
     this.Id            = id;
     this.frequency     = frequency;
     this.dataRange.Min = min;
     this.dataRange.Max = max;
     this.band          = band;
 }
Ejemplo n.º 28
0
 public void AddBand(int order, AvrViewBand band)
 {
     band.ViewID = m_ViewID;
     band.SavePivotSettings(order, band);
     band.SetUnchanged();
     band.Owner = this;
     Bands.Add(band);
 }
Ejemplo n.º 29
0
        public List <AvrViewColumn> GetSortColumns()
        {
            var ret = new List <AvrViewColumn>();

            Bands.FindAll(x => !x.IsToDelete).ForEach(b => b.GetSortColumns(ref ret));
            ret.AddRange(Columns.FindAll(x => !x.IsToDelete && x.SortOrder != null && x.SortOrder != -1));
            return(ret);
        }
Ejemplo n.º 30
0
        public void BindData2(DataTable da)
        {
            GroupHeader1.Visible = true;
            xrTable10.Visible    = true;
            xrTable11.Visible    = true;
            xrTableCell18.Text   = "Ghi chú";

            DataSource = da;



            XRSummary summarytotal  = new XRSummary();
            XRSummary summarytotal1 = new XRSummary();
            XRSummary summarytotal3 = new XRSummary();


            Bands.Add(GroupHeader1);
            GroupField groupField = new GroupField("Nhóm");

            GroupHeader1.GroupFields.Add(groupField);
            xrTableCell2.DataBindings.Add("Text", DataSource, "Nhóm");

            xrTableCell4.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}");
            XRSummary summary = new XRSummary();

            summary.Running          = SummaryRunning.Group;
            summary.IgnoreNullValues = true;
            summary.FormatString     = "{0:n0}";
            xrTableCell4.Summary     = summary;

            xrTableCell5.DataBindings.Add("Text", DataSource, "Số lượng quy đổi", "{0:n2}");
            XRSummary summary1 = new XRSummary();

            summary1.Running          = SummaryRunning.Group;
            summary1.IgnoreNullValues = true;
            summary1.FormatString     = "{0:n2}";
            xrTableCell5.Summary      = summary1;



            summarytotal.Running          = SummaryRunning.Report;
            summarytotal.IgnoreNullValues = true;
            summarytotal.FormatString     = "{0:n0}";
            xrTableCell22.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}");
            xrTableCell22.Summary = summarytotal;

            summarytotal1.Running          = SummaryRunning.Report;
            summarytotal1.IgnoreNullValues = true;
            summarytotal1.FormatString     = "{0:n2}";
            xrTableCell23.DataBindings.Add("Text", DataSource, "Số lượng quy đổi", "{0:n2}");
            xrTableCell23.Summary = summarytotal1;


            xrTableCell16.DataBindings.Add("Text", DataSource, "Mã hàng");
            xrTableCell10.DataBindings.Add("Text", DataSource, "Tên hàng");
            xrTableCell11.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}");
            xrTableCell12.DataBindings.Add("Text", DataSource, "Số lượng quy đổi", "{0:n2}");
        }
Ejemplo n.º 31
0
        private void GetSortColumns(ref List <AvrViewColumn> list)
        {
            foreach (var band in Bands.FindAll(x => !x.IsToDelete))
            {
                band.GetSortColumns(ref list);
            }

            list.AddRange(Columns.FindAll(x => !x.IsToDelete && x.SortOrder != null && x.SortOrder != -1));
        }
Ejemplo n.º 32
0
    public bool EventIsActive(Bands b, int c, EventTypes e)
    {
        if (e == EventTypes.BEAT)
        {
            return bandData[bandOffsets[c, (int) b]].Beat;
        }
        else if (e == EventTypes.VIBRATION)
        {
            return bandData[bandOffsets[c, (int) b]].Vibration;
        }

        return false;
    }
Ejemplo n.º 33
0
		public ChannelParams(int id, uint frequency, Datarates min, Datarates max, Bands band)
		{
			this.Id = id;
			this.frequency = frequency;
			this.dataRange.Min = min;
			this.dataRange.Max = max;
			this.band = band;
		}
Ejemplo n.º 34
0
    public AudioBand GetBand(Bands b, int c)
    {
        int channelOffset = numBands * c;

        return bandData[((int) b) + channelOffset];
    }