public static void Main() { // set the directory string testCase = (@"C:\Users\Duotong\Desktop\2019SUM\LocalVoltageControl\Test1\\"); string inputdatafolder = (@"C:\Users\Duotong\Desktop\2019SUM\LocalVoltageControl\Test1\Data\\"); string logsfolder = (@"C:\Users\Duotong\Desktop\2019SUM\LocalVoltageControl\Test1\Logs\\"); string pythonCmdPath = (@"C:\Users\Duotong\Desktop\2019SUM\LocalVoltageControl\Test1\pythonCode\\"); // Set the Path for BenchMark Model and Configuration string caseName = testCase + "2019SUM_2013Series_Updated_forLocalVoltageControl_BenchMark.sav"; string testCaseName = testCase + "2019SUM_2013Series_Updated_forLocalVoltageControl_BenchMark_test.sav"; string configurationPathName = inputdatafolder + "Configurations.xml"; VoltVarControllerAdapter VCAdapter = new VoltVarControllerAdapter(); ReadInputAdapter ReadIn = new ReadInputAdapter(); VoltVarController Frame = new VoltVarController(); PythonScripts Python = new PythonScripts(); VoltVarController PreviousFrame = new VoltVarController(); #region [ Initialization ] Python.CleanCmd(pythonCmdPath + "CleanData.py", inputdatafolder, logsfolder, pythonCmdPath, caseName, testCaseName); // clean the inputd data, delete the logs, and copy the benchmark model VCAdapter.ConfigurationPathName = configurationPathName; VCAdapter.Initialize(); PreviousFrame = VoltVarController.DeserializeFromXml(configurationPathName); #endregion #region [ Execute Program for Each Frame ] for (int i = 0; i < 30; i++) { int rowNumber = i + 1; string inputFileName = inputdatafolder + String.Format("{0:yyyy-MM-dd hh-mm-ss}_{1}", DateTime.UtcNow, rowNumber) + ".xml"; string logsFileName = logsfolder + String.Format("{0:yyyy-MM-dd hh-mm-ss}_{1}", DateTime.UtcNow, rowNumber) + " Logs.xml"; Frame = ReadIn.ReadFrame(inputdatafolder, inputFileName, rowNumber); VCAdapter.PublishFrame(Frame, inputdatafolder, PreviousFrame); PreviousFrame = VCAdapter.InputFrame; VCAdapter.InputFrame.SerializeToXml(inputFileName); VCAdapter.SerializeToXml(logsFileName); #region [ Control PSSE ] try { Python.RunCmd(pythonCmdPath + "DVPScaleLoad.py", VCAdapter.LogMessage, inputdatafolder, VCAdapter.InputFrame.SubstationInformation, testCaseName, VCAdapter.InputFrame.ControlCapacitorBanks[0], VCAdapter.InputFrame.ControlCapacitorBanks[1]); //Console.ReadLine(); //if (i == 0) //{ // Console.ReadLine(); //} } catch { Console.ReadLine(); } #endregion } #endregion }