Beispiel #1
0
 public Form2(GlobalObj _gb)
 {
     gb = _gb;
     InitializeComponent();
     if (GlobalClass.TypeDataPoints.ContainsKey("CN_Stock_A"))
     {
         dtp = GlobalClass.TypeDataPoints["CN_Stock_A"];
     }
     //gb.Sys = new SystemGlobal(gb.w);
 }
Beispiel #2
0
        static void Main()
        {
            ////MissDataSerial mcc = new MissDataSerial(300);
            ////mcc.OpList = new[] { 0, 2, 3, 1, 200, 90, 1, 1, 1, 1, 0 }.ToList();
            ////for(int i=1;i<10;i++)
            ////{
            ////    mcc = mcc.getAdd(i%10==0?1:0);
            ////}
            //return;
            Main1();
            return;

            Application.Run(new frm_ImageTextRead());
            return;

            //////////测试读取数据
            //////////GlobalObj gb = new GlobalObj();
            ////////GlobalClass gc = new GlobalClass();
            ////////string str = GlobalClass.dbName;//触发静态
            ////////KL12_HtmlDataClass hd = new KL12_HtmlDataClass(GlobalClass.TypeDataPoints["SCKL12"]);
            ////////ExpectList<TimeSerialData> el = hd.getExpectList<TimeSerialData>();
            ////////return;
            splitFile("share", "function(", '}');
            //return;
            LogableClass.ToLog("初始化服务器全局设置", "开始");
            InitSystem <TimeSerialData>();
            LogableClass.ToLog("启动通道", "开始");
            new CommuniteClass().StartIPCServer();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            GlobalObj gb = new GlobalObj();
            ////gb.w = new WindAPI();
            ////gb.w.start();
            ReceiveService <TimeSerialData> rc = new ReceiveService <TimeSerialData>();

            rc.Start();
            Form2 frm = new Form2(gb);

            Application.Run(frm);
        }
Beispiel #3
0
        static void Main1()
        {
            //splitFile("share", "function(", '}');
            //return;
            LogableClass.ToLog("初始化服务器全局设置", "开始");
            InitSystem <TimeSerialData>();
            LogableClass.ToLog("启动通道", "开始");
            new CommuniteClass().StartIPCServer();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            GlobalObj gb = new GlobalObj();
            ////gb.w = new WindAPI();
            ////gb.w.start();
            ReceiveService <TimeSerialData> rc = new ReceiveService <TimeSerialData>();

            rc.setGlobalClass(AllServiceConfig.gc);
            rc.CalcProcess = new CalcService <TimeSerialData>();
            rc.Start();
            Form2 frm = new Form2(gb);

            Application.Run(frm);
        }
Beispiel #4
0
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main2()
        {
            splitFile("share", "function", '}');
            return;

            try
            {
                ////DateTime dt = new DateTime(1991,4,3,12,0,1,12);
                ////DateTime bt = DateTime.Parse("1990-01-01");
                ////long val = (long)MongoDateTime.Stamp(dt);
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //ServiceBase[] ServicesToRun;

                //只有接收数据是默认启动,计算服务由接收数据触发
                //ServicesToRun = new ServiceBase[]
                //{
                //    rs,sd
                //};
                LogableClass.ToLog("初始化服务器全局设置", "开始");
                InitSystem <TimeSerialData>();
                LogableClass.ToLog("启动通道", "开始");
                new CommuniteClass().StartIPCServer();
                //ServiceBase.Run(ServicesToRun);
                GlobalObj gb = new GlobalObj();
                //gb.w = new WindAPI();
                //gb.w.start();
                //new ReceiveService().Start();

                Form2 frm = new Form2(gb);
                Application.Run(frm);
            }
            catch (Exception e)
            {
                LogableClass.ToLog("初始化服务失败", e.StackTrace);
            }
        }
Beispiel #5
0
        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            //DataTable table = (DataTable)dataGridView1.DataSource;//数据源
            //string secid = table.Rows[e.RowIndex]["wind_code"].ToString();
            //string SecName = table.Rows[e.RowIndex]["sec_name"].ToString();
            string        secid   = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["wind_code"].Value.ToString();
            string        SecName = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["sec_name"].Value.ToString();
            SecIndexClass sic     = new SIIIClass();

            sic.IndexCode = secid;
            secIndexBuilder sib = new secIndexBuilder(this.gb.w, sic);
            MTable          mt  = sib.getBkWeight(this.txt_EndT.Value);

            if (mt == null)
            {
                return;
            }
            DataTable dt = mt.GetTable();

            if (dt == null || dt.Rows.Count == 0 || !dt.Columns.Contains("i_weight"))
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show(secid + "无详细信息!");
                return;
            }
            dt.Columns["i_weight"].DataType = typeof(float);
            dt.Columns.Add("CurrCycleValue", typeof(float));

            string[] sectors = new string[dt.Rows.Count];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sectors[i] = dt.Rows[i]["wind_code"].ToString();
            }
            KDJGuidClass kdj = new KDJGuidClass(9, 3, 3);

            kdj.cycle    = (Cycle)this.ddl_cycle.SelectedIndex;
            kdj.priceAdj = (PriceAdj)this.ddl_priceAdj.SelectedIndex;
            GuidBuilder_ForWD gb    = new GuidBuilder_ForWD(this.gb.w, kdj);
            MTable            newdt = gb.getRecords(sectors, this.txt_EndT.Value);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["CurrCycleValue"] = newdt.GetTable().Rows[i][0];
            }
            if (this.ddl_cycle.SelectedIndex > 0)
            {
                dt.Columns.Add("LowCycleValue", typeof(float));
                kdj.cycle = (Cycle)this.ddl_cycle.SelectedIndex - 1;
                gb        = new GuidBuilder_ForWD(gb.w, kdj);
                newdt     = gb.getRecords(sectors, this.txt_EndT.Value);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["LowCycleValue"] = newdt.GetTable().Rows[i][0];
                }
            }
            Form dlgfrm = new Form();

            DrawForm(dlgfrm);
            DataGridView ddgrid = new DataGridView();

            dlgfrm.Controls.Add(ddgrid);
            DrawGrid(ddgrid);
            //dataGridView1.CellMouseDoubleClick += new DataGridViewCellMouseEventHandler(dataGridView1_CellMouseDoubleClick);
            ddgrid.DataSource = dt;
            ddgrid.Tag        = dt;
            ddgrid.Show();
            dlgfrm.TopMost = true;
            dlgfrm.Text    = SecName;
            dlgfrm.ShowDialog(this);
            this.Cursor = Cursors.Default;
        }
Beispiel #6
0
 public frm_siII(GlobalObj _gb)
 {
     gb = _gb;
     InitializeComponent();
     initForm();
 }
Beispiel #7
0
 public frm_Query(GlobalObj _gb)
 {
     gb = _gb;
     InitializeComponent();
 }