Ejemplo n.º 1
0
        void ichart_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            var pos = e.Location;
            var results = ichart.HitTest(pos.X, pos.Y, false, ChartElementType.DataPoint);
            //foreach (var result in results)
            {
                if (results[0].ChartElementType == ChartElementType.DataPoint)
                {
                    DataPoint point = results[0].Object as DataPoint;
                    var xval = (int)point.XValue;
                    var yval = (int)point.YValues[0];

                    CTextInput2 ct = new CTextInput2();
                    string text = ct.Show("Yield Text");
                    if (MessageBox.Show("Lägga till text för punkt " + xval.ToString() + ":" + yval.ToString() + " ?", "Yield Text", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {

                        OSQLite sql = new OSQLite();
                        GraphDataSet gd = sql.miGetYield2(curdate);
                        string name = "SNO." + gd.SNO[xval].ToString() + "." + gd.Y[xval].ToString();
                        LiteCConfig cfg = new LiteCConfig("Yieldtext.xml");
                        cfg.Add(name, text);
                    }
                }
            }

            yieldtexts.Clear();
            yieldserials.Clear();
            LiteCConfig cfb = new LiteCConfig("Yieldtext.xml");
            yieldtexts = cfb.Read();

            foreach (LiteCParameter x in yieldtexts)
            {
                yieldserials.Add(x.Name.Split('.')[1]);
            }
            FillYield(curdate, curweek, showlab);
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            InitializeComboBox();
            InstrumentComboBox.SelectedIndex = 0;
            LiteCConfig cfg = new LiteCConfig("Yieldtext.xml");
            gProblem = new LiteCGraph(chProblem, this.tpProblem);
            gComponents = new LiteCGraph(chComponents, this.tpKomponenter);
            gYield = new LiteCGraph(chYield, this.tpYield, cfg.Read());
            gUser = new LiteCGraph(chUser, this.tpUser);
            gCV = new LiteCGraph(chCV, this.tpCV);

            for (int i = 1; i <= 52; i++)
                cbWeeks.Items.Add(i);
            cbWeeks.SelectedIndex = 3;

            int years = DateTime.Now.Year - 2000 - 6;
            for (int i = 1; i <= years; i++)
                cbYears.Items.Add(i);
        }
Ejemplo n.º 3
0
        private void InitializeComboBox()
        {
            LiteCConfig cfg = new LiteCConfig(/*xmlDynamicDirectory +*/ "Instruments.xml");
            InstrumentComboBox.Items.Clear();

            //Using temp List<> for easy sorting
            List<string> temp = new List<string>();
            foreach (LiteCParameter x in cfg.Read()) { temp.Add(x.Value); }
            temp.Sort();
            foreach (string x in temp) { InstrumentComboBox.Items.Add(x); }
        }
Ejemplo n.º 4
0
        void dgView_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete)
            {
                LiteCConfig del = new LiteCConfig(xmlfilename);
                String param = dgView.SelectedCells[0].Value.ToString();

                del.DeleteParameter(param);
                dgView.Rows.Clear();
                foreach (LiteCParameter x in del.Read())
                {
                    dgView.Rows.Add();
                    dgView.Rows[dgView.Rows.Count - 2].Cells[0].Value = x.Name;
                    dgView.Rows[dgView.Rows.Count - 2].Cells[1].Value = x.Value;
                }
            }
        }