private void dataReadFromSimulatedData(string dataFilePath_Simulated, string dataFilePath_Mode)
        {
            Txt_Handle txt_Handle = new Txt_Handle();

            string[] dataRead_Simulated = txt_Handle.dataRead(dataFilePath_Simulated);
            string[] dataRead_Mode = txt_Handle.dataRead(dataFilePath_Mode);

            charge_HA.Text = dataRead_Simulated[0];

            double h_HA_Double = Convert.ToDouble(dataRead_Simulated[1]);
            h_HA.Value = Convert.ToDecimal(System.Math.Abs(h_HA_Double));
            savedH_HA.Value = Convert.ToDecimal(dataRead_Simulated[2]);

            charge_EA.Text = dataRead_Simulated[3];
            duration_EA.Value = Convert.ToDecimal(dataRead_Simulated[4]);
            speed_EA.Value = Convert.ToDecimal(dataRead_Simulated[5]);
            savedE_EA.Value = Convert.ToDecimal(dataRead_Simulated[6]);

            gear_Boiler.Value = Convert.ToDecimal(dataRead_Simulated[7]);
            duration_Boiler.Value = Convert.ToDecimal(dataRead_Simulated[8]);

            envrmtdata_lout_Heat.Value = Convert.ToDecimal(dataRead_Simulated[9]);
            duration_Heat.Value = Convert.ToDecimal(dataRead_Simulated[10]);

            envrmtdata_lout_Electricity.Value = Convert.ToDecimal(dataRead_Simulated[11]);
            duration_Electricity.Value = Convert.ToDecimal(dataRead_Simulated[12]);

            gear_UE.Value = Convert.ToDecimal(dataRead_Simulated[13]);
            duration_UE.Value = Convert.ToDecimal(dataRead_Simulated[14]);

            price_E.Value = Convert.ToDecimal(dataRead_Simulated[15]);
            price_H.Value = Convert.ToDecimal(dataRead_Simulated[16]);
            price_G.Value = Convert.ToDecimal(dataRead_Simulated[17]);

            switch (dataRead_Mode[0])
            {
                case "1":
                    Mode.Text = "经济";
                    break;
                case "2":
                    Mode.Text = "节能";
                    break;
                case "4":
                    Mode.Text = "经济+节能";
                    break;
            }
        }
Example #2
0
        private void needReadFromFile(string needFilePath)
        {
            Txt_Handle txt_Handle = new Txt_Handle();
            string[] dataRead_EnergyNeed = txt_Handle.dataRead(needFilePath);

            need_E.Content = dataRead_EnergyNeed[0];
            need_H.Content = dataRead_EnergyNeed[1];
        }
Example #3
0
        private List<string>[] equStateReadFromFile(string equipmentFilePath, string stateFilePath)
        {
            Txt_Handle txt_Handle = new Txt_Handle();

            string[] strEqu = txt_Handle.dataRead(equipmentFilePath);
            string[] strState = txt_Handle.dataRead(stateFilePath);

            List<string> lsEqu = new List<string>(strEqu);
            List<string> lsState = new List<string>(strState);

            List<string>[] arrList = new List<string>[2];
            arrList[0] = lsEqu;
            arrList[1] = lsState;
            return arrList;
        }
        private void city_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //所选地区能源数据存储
            string path_NeedE_Winter = "";
            string path_NeedH_Winter = "";

            string path_NeedE_Summer = "";
            string path_NeedH_Summer = "";

            string path_NeedE_SA = "";

            switch (city.Text)
            {
                case "北京":
                    path_NeedE_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedE_W_Beijing.txt";
                    path_NeedH_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedH_W_Beijing.txt";

                    path_NeedE_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedE_S_Beijing.txt";
                    path_NeedH_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedH_S_Beijing.txt";

                    path_NeedE_SA = @"..\..\Local Storage\EnergyNeedFile\NeedE_SA_Beijing.txt";

                    break;
                case "上海":
                    path_NeedE_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedE_W_Shanghai.txt";
                    path_NeedH_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedH_W_Shanghai.txt";

                    path_NeedE_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedE_S_Shanghai.txt";
                    path_NeedH_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedH_S_Shanghai.txt";

                    path_NeedE_SA = @"..\..\Local Storage\EnergyNeedFile\NeedE_SA_Shanghai.txt";

                    break;

                case "广州":
                    path_NeedE_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedE_W_Guangzhou.txt";
                    path_NeedH_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedH_W_Guangzhou.txt";

                    path_NeedE_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedE_S_Guangzhou.txt";
                    path_NeedH_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedH_S_Guangzhou.txt";

                    path_NeedE_SA = @"..\..\Local Storage\EnergyNeedFile\NeedE_SA_Guangzhou.txt";

                    break;
                case "沈阳":
                    path_NeedE_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedE_W_Shenyang.txt";
                    path_NeedH_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedH_W_Shenyang.txt";

                    path_NeedE_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedE_S_Shenyang.txt";
                    path_NeedH_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedH_S_Shenyang.txt";

                    path_NeedE_SA = @"..\..\Local Storage\EnergyNeedFile\NeedE_SA_Shenyang.txt";

                    break;
                case "武汉":
                    path_NeedE_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedE_W_Wuhan.txt";
                    path_NeedH_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedH_W_Wuhan.txt";

                    path_NeedE_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedE_S_Wuhan.txt";
                    path_NeedH_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedH_S_Wuhan.txt";

                    path_NeedE_SA = @"..\..\Local Storage\EnergyNeedFile\NeedE_SA_Wuhan.txt";

                    break;
                case "重庆":
                    path_NeedE_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedE_W_Chongqing.txt";
                    path_NeedH_Winter = @"..\..\Local Storage\EnergyNeedFile\NeedH_W_Chongqing.txt";

                    path_NeedE_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedE_S_Chongqing.txt";
                    path_NeedH_Summer = @"..\..\Local Storage\EnergyNeedFile\NeedH_S_Chongqing.txt";

                    path_NeedE_SA = @"..\..\Local Storage\EnergyNeedFile\NeedE_SA_Chongqing.txt";

                    break;
            }

            Txt_Handle txt_Handle = new Txt_Handle();

            //读取所选地区能源数据
            string[] needE_Winter = txt_Handle.dataRead(path_NeedE_Winter);
            string[] needH_Winter = txt_Handle.dataRead(path_NeedH_Winter);

            string[] needE_Summer = txt_Handle.dataRead(path_NeedE_Summer);
            string[] needH_Summer = txt_Handle.dataRead(path_NeedH_Summer);

            string[] needE_SA = txt_Handle.dataRead(path_NeedE_SA);
            string[] needH_SA = new string[24];

            for (int i = 0; i < 24; i++)
            {
                needH_SA[i] = "0";
            }

            //要写入的文件
            string pathToWrite_NeedE_Winter = @"..\..\Local Storage\NeedE_W.txt";
            string pathToWrite_NeedH_Winter = @"..\..\Local Storage\NeedH_W.txt";

            string pathToWrite_NeedE_Summer = @"..\..\Local Storage\NeedE_S.txt";
            string pathToWrite_NeedH_Summer = @"..\..\Local Storage\NeedH_S.txt";

            string pathToWrite_NeedE_SA = @"..\..\Local Storage\NeedE_SA.txt";
            string pathToWrite_NeedH_SA = @"..\..\Local Storage\NeedH_SA.txt";

            //写入数据
            txt_Handle.dataWrite(pathToWrite_NeedE_Winter, needE_Winter);
            txt_Handle.dataWrite(pathToWrite_NeedH_Winter, needH_Winter);

            txt_Handle.dataWrite(pathToWrite_NeedE_Summer, needE_Summer);
            txt_Handle.dataWrite(pathToWrite_NeedH_Summer, needH_Summer);

            txt_Handle.dataWrite(pathToWrite_NeedE_SA, needE_SA);
            txt_Handle.dataWrite(pathToWrite_NeedH_SA, needH_SA);
        }
        private void dataReadFromNeedH(string dataFilePath)
        {
            Txt_Handle txt_Handle = new Txt_Handle();

            string[] dataRead = txt_Handle.dataRead(dataFilePath);

            for (int i = 0; i < 24; i++)
            {
                TAlex.WPF.Controls.NumericUpDown numbericUpDown = need.FindName("needH_" + i.ToString()) as TAlex.WPF.Controls.NumericUpDown;
                numbericUpDown.Value = Convert.ToDecimal(dataRead[i]);
            }
        }