Exemple #1
0
        private void ReadSeriesProperties()
        {
            textBoxName.Text          = m_series.Name;
            textBoxSiteName.Text      = m_series.SiteID;
            textBoxConnectString.Text = m_series.ConnectionString;
            textBoxProvider.Text      = m_series.Provider;
            textBoxNotes.Text         = m_series.Notes;
            textBoxExpression.Text    = m_series.Expression;
            checkBoxActive.Checked    = m_series.Enabled == 1;

            textBoxSource.Text = m_series.Source;
            if (m_series.Table == null)
            {
                textBoxDBTableName.Text = "";
            }
            else
            {
                textBoxDBTableName.Text = m_series.SeriesCatalogRow.TableName;
            }

            textBoxParameter.Text = m_series.Parameter;
            textBoxParentID.Text  = m_series.Parent.ID.ToString();
            PeriodOfRecord por = m_series.GetPeriodOfRecord();

            textBoxPOR1.Text        = por.T1.ToString();
            textBoxPOR2.Text        = por.T2.ToString();
            textBoxRecordCount.Text = por.Count.ToString();
            textBoxSiteID.Text      = m_series.ID.ToString();
            textBoxSortOrder.Text   = m_series.SortOrder.ToString();
            //textBoxAlias.Text = s.Alias;

            comboBoxUnits.SelectedItem = m_series.Units;

            //comboBoxDisplayUnits.Items.Clear();
            //comboBoxDisplayUnits.Items.Add("");
            //comboBoxDisplayUnits.Items.Add("degrees C");
            //comboBoxDisplayUnits.SelectedItem = s.DisplayUnits;
            //this.textBoxMath.Text = m_series.Expression;
            comboBoxTimeInterval.SelectedIndex = 0;
            comboBoxTimeInterval.SelectedItem  = m_series.TimeInterval.ToString();

            tblSeriesProperties = m_db.GetSeriesProperties();
            tblSeriesProperties.Columns["id"].AutoIncrement      = true;
            tblSeriesProperties.Columns["id"].AutoIncrementSeed  = tblSeriesProperties.NextID();
            tblSeriesProperties.Columns["seriesid"].DefaultValue = m_series.ID;
            dgvProperties.DataSource = tblSeriesProperties;
            tblSeriesProperties.DefaultView.RowFilter = "seriesid=" + m_series.ID;
            dgvProperties.Columns["id"].Visible       = false;
            dgvProperties.Columns["seriesid"].Visible = false;


            if (m_db.Settings.GetDBVersion() >= 3)
            {// alarms
                var ac = new SeriesPropertiesAlarm();
                ac.Parent = tabPageAlarm;
                ac.Dock   = DockStyle.Fill;
            }
            else
            {
                this.tabControl1.TabPages.Remove(this.tabPageAlarm);
            }
        }
Exemple #2
0
        private void ReadSeriesProperties()
        {
            textBoxName.Text = m_series.Name;
            textBoxSiteName.Text = m_series.SiteID;
            textBoxConnectString.Text = m_series.ConnectionString;
            textBoxProvider.Text = m_series.Provider;
            textBoxNotes.Text = m_series.Notes;
            textBoxExpression.Text = m_series.Expression;
            checkBoxActive.Checked = m_series.Enabled == 1;

            textBoxSource.Text = m_series.Source;
            if (m_series.Table == null)
                textBoxDBTableName.Text = "";
            else
                textBoxDBTableName.Text = m_series.SeriesCatalogRow.TableName;

            textBoxParameter.Text = m_series.Parameter;
            textBoxParentID.Text = m_series.Parent.ID.ToString();
            PeriodOfRecord por = m_series.GetPeriodOfRecord();
            textBoxPOR1.Text = por.T1.ToString();
            textBoxPOR2.Text = por.T2.ToString();
            textBoxRecordCount.Text = por.Count.ToString();
            textBoxSiteID.Text = m_series.ID.ToString();
            textBoxSortOrder.Text = m_series.SortOrder.ToString();
            //textBoxAlias.Text = s.Alias;

            comboBoxUnits.SelectedItem = m_series.Units;

            //comboBoxDisplayUnits.Items.Clear();
            //comboBoxDisplayUnits.Items.Add("");
            //comboBoxDisplayUnits.Items.Add("degrees C");
            //comboBoxDisplayUnits.SelectedItem = s.DisplayUnits;
            //this.textBoxMath.Text = m_series.Expression;
            comboBoxTimeInterval.SelectedIndex = 0;
            comboBoxTimeInterval.SelectedItem = m_series.TimeInterval.ToString();

            tblSeriesProperties = m_db.GetSeriesProperties();
            tblSeriesProperties.Columns["id"].AutoIncrement = true;
            tblSeriesProperties.Columns["id"].AutoIncrementSeed = tblSeriesProperties.NextID();
            tblSeriesProperties.Columns["seriesid"].DefaultValue = m_series.ID;
            dgvProperties.DataSource = tblSeriesProperties;
            tblSeriesProperties.DefaultView.RowFilter = "seriesid=" + m_series.ID;
            dgvProperties.Columns["id"].Visible = false;
            dgvProperties.Columns["seriesid"].Visible = false;

            if (m_db.Settings.GetDBVersion() >=3 )
            {// alarms
                var ac = new SeriesPropertiesAlarm();
                ac.Parent = tabPageAlarm;
                ac.Dock = DockStyle.Fill;

            }
            else
            {
                this.tabControl1.TabPages.Remove(this.tabPageAlarm);
            }
        }