Beispiel #1
0
        public static void ReadGridDataFromFile(winForms_GridControlsSetup grid, string fileName)
        {
            using (var sr = new StreamReader(fileName))
            {
                while (sr.Peek() >= 0)
                {
                    string   sLine;
                    string[] sArrData;
                    sLine = sr.ReadLine();

                    sArrData = sLine.Split(',');

                    string sMacroX = sArrData[0];
                    string sMacroY = sArrData[1];
                    string sMacro  = AddressConcat(sMacroX, sMacroY);

                    string sSubX = sArrData[2];
                    string sSubY = sArrData[3];
                    string sSub  = AddressConcat(sSubX, sSubY);

                    string sMicroX = sArrData[4];
                    string sMicroY = sArrData[5];
                    string sMicro  = AddressConcat(sMicroX, sMicroY);

                    string sFloatValue = sArrData[6];
                    double dFloatData;

                    if (sFloatValue == "")
                    {
                        dFloatData = 0;
                    }
                    else
                    {
                        dFloatData = Double.Parse(sFloatValue);
                    }

                    string sState = sArrData[7];

                    switch (sState)
                    {
                    case "Scheduled": sState = "1"; break;

                    case "In Progress": sState = "2"; break;

                    case "Complete": sState = "3"; break;

                    case "Cancelled": sState = "4"; break;

                    case "Inspected": sState = "5"; break;
                    }

                    IGridBlock_Base micro = grid.Cuboid.GetChild_MicroGridBlock(sMacro, sSub, sMicro);
                    micro.State_Setup(dFloatData, Int32.Parse(sState));
                }
            }
        }
Beispiel #2
0
        private void GenerateGrids()
        {
            if (R1 == null)
            {
                this.R1 = new GridControl_Row();
                //
                // R1
                //
                this.R1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                this.R1.Dock        = System.Windows.Forms.DockStyle.Top;
                this.R1.GridState   = null;
                this.R1.Location    = new System.Drawing.Point(3, 16);
                this.R1.Name        = "R1";
                this.R1.Size        = new System.Drawing.Size(1142, 468);
                this.R1.TabIndex    = 0;
                this.groupBox6.Controls.Add(this.R1);
            }

            Frontend_Settings();

            _grids = new winForms_GridControlsSetup(R1, _Settings, onGridClick);
        }
Beispiel #3
0
        public static void ReadGridDataFromFile(winForms_GridControlsSetup grid, DataTable gridData)
        {
            foreach (DataRow dr in gridData.Rows)
            {
                double dValue;
                string sMacro         = dr["Macro Block Name (Grid One)"].ToString().Replace(',', '_');
                string sSub           = dr["Sub Block Name (Grid Two)"].ToString().Replace(',', '_');
                string sMicro         = dr["Micro Block Name (Grid Three)"].ToString().Replace(',', '_');
                string sValue         = dr["Value"].ToString();
                string sProgressState = dr["FKProgressState"].ToString();

                if (sValue == "")
                {
                    dValue = 0;
                }
                else
                {
                    dValue = Double.Parse(sValue);
                }

                IGridBlock_Base micro = grid.Cuboid.GetChild_MicroGridBlock(sMacro, sSub, sMicro);
                micro.State_Setup(dValue, Int32.Parse(sProgressState));
            }
        }