示例#1
0
            public static void ReadFromXML(out int time1, out int time2)
            {
                string filename = "Config/time.xml";

                // path = string.Empty;
                time1 = 90;
                time2 = 150;
                if (File.Exists(filename))
                {
                    XmlDocument xmlDoc = new XmlDocument();
                    xmlDoc.Load(filename);
                    var root = xmlDoc.DocumentElement;

                    XmlNode singleChild = xmlDoc.SelectSingleNode("time/time1");
                    time1 = int.Parse(singleChild.InnerText);

                    singleChild = xmlDoc.SelectSingleNode("time/time2");
                    time2       = int.Parse(singleChild.InnerText);

                    //singleChild = xmlDoc.SelectSingleNode("time/source");
                    //path = singleChild.InnerText.ToString();
                }
                else
                {
                    TimeXmlHelper.WriteToXML(time1, time2);
                    ReadFromXML(out time1, out time2);
                }
            }
示例#2
0
        public CDataGridViewRTD()
            : base()
        {
            m_listEntityRTD = new List <CEntityRealTime>();
            // 设定标题栏,默认有个隐藏列
            this.Header = new string[]
            {
                CS_StationName, CS_StationId, CS_TimeCollected, CS_SHFX, CS_DelayTime, CS_SHFS, CS_avg10fx,
                CS_avg10fs, CS_Visi1min, CS_Visi10min, CS_Depth, CS_Tmp, CS_Ntu, CS_Cndcty, CS_Salinity,
                CS_Volatage
            };
            // 隐藏延迟列,串口列
            //base.ColumnHeadersHeight = 50;
            base.HideColomns = new int[] { 4 };
            // 设置一页的数量
            this.PageRowCount = CDBParams.GetInstance().UIPageRowCount;
            string path = string.Empty;

            time1 = 90;
            time2 = 150;
            TimeXmlHelper.ReadFromXML(out time1, out time2);

            this.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            //RecalculateHeaderSize();
        }
示例#3
0
        public CDataGridViewRTD()
            : base()
        {
            m_listEntityRTD = new List <CEntityRealTime>();
            // 设定标题栏,默认有个隐藏列
            this.Header = new string[]
            {
                CS_StationName, CS_StationId, CS_StationType, CS_TimeCollected, CS_DelayTime,
                CS_TodayRain, CS_LastdayRain, CS_PeriodRain, CS_WaterLevel, CS_V1, CS_V2, CS_V3, CS_V4, CS_WaterFlowActual, CS_WaterFlowFindInTable,
                CS_Volatage, CS_Port, CS_MsgType, CS_ChannelType
            };
            // 隐藏延迟列,串口列
            base.HideColomns = new int[] { 4, 5, 6, 7, 16 };
            // 设置一页的数量
            this.PageRowCount = CDBParams.GetInstance().UIPageRowCount;
            string path = string.Empty;

            time1 = 90;
            time2 = 150;
            TimeXmlHelper.ReadFromXML(out time1, out time2);
            //this.PageRowCount = 300;   //  默认一页显示数量

            //DataGridViewNumericUpDownColumn stationId = new DataGridViewNumericUpDownColumn()
            //{
            //    Minimum = 0,
            //    Maximum = 65537,
            //    DecimalPlaces = 0 /*好像是设置小数点后面的位数*/

            //};
            //this.SetColumnEditStyle(1, stationId);

            // 绑定消息,用于按照ID排序
            //this.SortCompare += new DataGridViewSortCompareEventHandler(this.EHSortCompare);
            //this.CellValueNeeded += new DataGridViewCellValueEventHandler(this.EHCellValueNeeded);
            //this.sort

            // 设置数据类型
            //this.Columns[CS_StationId].ValueType = typeof(int);
            // m_dataTable.Columns[CS_StationId].DataType = System.Type.GetType("System.Int32");
            this.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
        }