Beispiel #1
0
        private List <columns> build_custom_cols(Dictionary <int, string> custom, decimal conv_factor)
        {
            List <columns> cols = new List <columns>();

            foreach (int key in custom.Keys)
            {
                columns temp = new columns();
                temp.column_num = key + 1;
                temp.title      = custom[key];

                temp.definition  = "";
                temp.conv_factor = conv_factor;

                if (custom[key].ToLower() == "time" || custom[key].ToLower() == "year")
                {
                    temp.time       = true;
                    temp.definition = "year";
                }
                else if (temp.title.Contains("modflow_"))
                {
                    temp.definition = temp.title.Substring(8);
                }
                else
                {
                    temp.definition = custom[key];
                }
                cols.Add(temp);
            }
            return(cols);
        }
Beispiel #2
0
        public async Task <IActionResult> Putcolumns(long id, columns columns)
        {
            var bat = _context.columns.Find(id);

            if (bat == null)
            {
                return(NotFound());
            }

            bat.status = columns.status;

            _context.columns.Update(bat);
            _context.SaveChanges();
            var json = new JObject();

            json["message"] = "the change of status is well done";
            return(Content(json.ToString(), "application/json"));
        }
        public IActionResult Update(long id, columns column)
        {
            var col = _context.columns.Find(id);

            if (col == null)
            {
                return(NotFound());
            }

            col.Status = column.Status;

            _context.columns.Update(col);
            _context.SaveChanges();
            var json = new JObject();

            json["New Status"] = column.Status;
            json["message"]    = "The Status of the Column Id: " + col.id + " has been changed to: " + col.Status;
            return(Content(json.ToString(), "application/json"));
        }
Beispiel #4
0
        private List <columns> build_orig_cols(string[] header1, decimal conv_factor)
        {
            //format of columns '##-##'
            var r = new Regex("^\\d*-\\d*$");

            List <columns> cols = new List <columns>();

            for (int i = 0; i < header1.Length; i++)
            {
                columns temp = new columns();
                temp.column_num = i + 1;
                //if (header2 != null && header2.Length > i)
                //    temp.title = String.Format("{0} {1}", header1[i], header2[i]);
                //else
                //    temp.title = header1[i];
                temp.title = header1[i];

                temp.definition  = "";
                temp.conv_factor = conv_factor;

                if (header1[i].ToLower() == "time")
                {
                    temp.time       = true;
                    temp.definition = "year";
                }
                else if (temp.title.Contains("modflow_"))
                {
                    temp.definition = temp.title.Substring(8);
                }
                else if (r.IsMatch(temp.title))
                {
                    temp.definition = temp.title;
                }
                else
                {
                    temp.definition = "";
                }
                cols.Add(temp);
            }
            return(cols);
        }
Beispiel #5
0
 var(columns, writeDelegate) = WriteDelegates.GetOrAdd(typeof(TTuple), k => CreateWriteDelegate <TTuple>());
Beispiel #6
0
        protected override void renderCell(GraphicsContext g, object value, CellRenderState rs, columns.IColumn c)
        {
            c.renderCellBackground(g, rs);

            //g.Graphics.DrawImage(
        }
 return(new DiagonalMatrix(DiagonalMatrixStorage <float> .OfIndexedEnumerable(rows, columns, diagonal)));
Beispiel #8
0
        //private List<columns> column_def;
        private void load_srf(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openfiledialog1 = new OpenFileDialog();
            process_srf    srf             = new process_srf();

            //openfiledialog1.InitialDirectory = dir;
            if (delim == ',')
            {
                openfiledialog1.Filter = "csv (*.csv)|*.csv|srf (*.srf)|*.srf|dat (*.dat)|*.dat|All Files (*.*)|*.*";
            }
            else
            {
                openfiledialog1.Filter = "All Files (*.*)|*.*|csv (*.csv)|*.csv|srf (*.srf)|*.srf|dat (*.dat)|*.dat";
            }
            openfiledialog1.FilterIndex      = 1;
            openfiledialog1.Multiselect      = true;
            openfiledialog1.RestoreDirectory = false;  //leave it where the files actually are for reading the raw data files (03-27-2012)

            openfiledialog1.Title = "Select file(s) to be processed:";

            openfiledialog1.ShowDialog();
            //check that one or more files were selected.
            using (new WaitCursor())
            {
                if (openfiledialog1.FileNames.Length > 0)
                {
                    string outpath = System.IO.Path.GetDirectoryName(openfiledialog1.FileName) + "\\";
                    files  = openfiledialog1.FileNames;
                    srf.h1 = string_to_int(tb_h1_row.Text);
                    srf.h2 = string_to_int(tb_h2_row.Text);
                    srf.process_header(openfiledialog1.FileName, delim);
                    if (srf.line_header1 == null)
                    {
                        files = null;
                        return;
                    }
                    if (srf.h1.ToString() != tb_h1_row.Text)
                    {
                        tb_h1_row.Text = srf.h1.ToString();
                    }
                    if (srf.h2.ToString() != tb_h2_row.Text)
                    {
                        tb_h2_row.Text = srf.h2.ToString();
                    }

                    tb_fileName.Text = String.Join(Environment.NewLine, files);

                    openfiledialog1 = null;

                    header1 = srf.line_header1;
                    header2 = srf.line_header2;
                    //
                    colSet.column_def = new List <columns>();

                    if (srf.line_header1 != null)
                    {
                        for (int i = 0; i < srf.line_header1.Length; i++)
                        {
                            columns temp = new columns();
                            temp.column_num = i + 1;
                            //if (header2 != null && header2.Length > i)
                            //    temp.title = String.Format("{0} {1}", header1[i], header2[i]);
                            //else
                            //    temp.title = header1[i];
                            temp.title = header1[i];

                            temp.definition  = "";
                            temp.conv_factor = 1;
                            if (ckbx_ci_pci.IsChecked == true)
                            {
                                temp.conv_factor = 1000000000000;
                            }
                            else if (ckbx_g_ug.IsChecked == true)
                            {
                                temp.conv_factor = 1000000;
                            }
                            else if (ckbx_custom.IsChecked == true)
                            {
                                temp.conv_factor = string_to_decimal(tb_custom.Text);
                            }
                            if (header1[i].ToLower() == "time")
                            {
                                temp.time       = true;
                                temp.definition = "year";
                            }
                            else if (temp.title.Contains("modflow_"))
                            {
                                temp.definition = temp.title.Substring(8);
                            }
                            else
                            {
                                temp.definition = "";
                            }
                            colSet.column_def.Add(temp);
                        }
                    }
                    colSet.refresh();
                    if (tb_outdir.Text == null || tb_outdir.Text == "")
                    {
                        tb_outdir.Text = outpath + "\\";
                    }
                }
            }
        }
Beispiel #9
0
 Begin(columns, rows);
Beispiel #10
0
 public void addPiece(ChessPiece piece, columns column, int linha)
 {
     board[linha - 1, int.Parse(column.ToString())].Piece = piece;
 }
Beispiel #11
0
        public void render(GraphicsContext g, columns.ColumnCollection visible_columns)
        {
            GraphicsState gs = g.Graphics.Save();

            if (this.formatter == null)
            {
                g.Graphics.Clear(Color.White);
            }
            else
            {
                g.Graphics.Clear(this.formatter.BackgroundColor);
            }

            int row_height = (int)Math.Floor(g.Graphics.ClipBounds.Height);

            foreach (IColumn c in visible_columns)
            {
                g.Graphics.SetClip(new Rectangle(0, 0, c.Width, this.Height));
                CellRenderState rs;
                if (this.IsSelectedCell(c.Name))
                {
                    rs = CellRenderState.Selected;
                }
                else
                {
                    rs = CellRenderState.Normal;
                }

                this.renderCell(g, this.cells_values[c.Name], rs, c);
                g.Graphics.TranslateTransform(c.Width, 0);
            }

            g.Graphics.Restore(gs);
        }