Ejemplo n.º 1
0
        public static TableMakerProduct GenerateRCTable(Project project, RCModel rcModel)
        {
            var    OutFolder    = $@"{GlobalSettings.RootPath}{project.BatteryType.Name}\{project.Name}\{GlobalSettings.ProductFolderName}";
            string filePath     = Path.Combine(OutFolder, rcModel.FilePath);//GetRCTableFilePath(project);
            var    strRCHeader  = GetRCFileHeader(project, rcModel.fCTABase, rcModel.fCTASlope);
            var    strRCContent = GetRCFileContent(rcModel.outYValue, project.VoltagePoints, rcModel.listfTemp, rcModel.listfCurr);

            //UInt32 uErr = 0;
            TableMakerService.CreateFile(filePath, strRCHeader.Concat(strRCContent).ToList());
            TableMakerProduct tmp = new TableMakerProduct();

            tmp.FilePath = filePath;
            tmp.IsValid  = true;
            tmp.Project  = project;
            return(tmp);
        }
Ejemplo n.º 2
0
        private static bool GenerateCHFiles(ref UInt32 uErr, string OutFolder, string strCFileStandardName, string strHFileStandardName, List <string> strHHeaderComments, List <int> ilstOCVVolt, List <int> voltList, List <float> listfTemp, List <float> listfCurr, List <List <int> > outYValue, double fCTABase, double fCTASlope)
        {
            bool   bReturn;
            string standardCFilePath = System.IO.Path.Combine(OutFolder, strCFileStandardName);
            string standardHFilePath = System.IO.Path.Combine(OutFolder, strHFileStandardName);

            List <string> hFileContent = GetHFileContent(strHFileStandardName, strHHeaderComments, ilstOCVVolt, voltList, listfCurr, listfTemp, fCTABase, fCTASlope);

            TableMakerService.CreateFile(standardHFilePath, hFileContent);

            List <string> cFileContent = GetCFileContent(strCFileStandardName, strHFileStandardName, strHHeaderComments, ilstOCVVolt, voltList, listfTemp, listfCurr, outYValue, fCTABase, fCTASlope);

            TableMakerService.CreateFile(standardCFilePath, cFileContent);

            bReturn = true;
            uErr    = 1;

            return(bReturn);
        }