From dfc1537ff76ae83283c33e11f0a4b1b37966faaa Mon Sep 17 00:00:00 2001 From: William Fouvy Date: Sun, 12 Apr 2015 14:10:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?modify:=20=E6=8B=93=E5=B1=95=E5=90=8D?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2db3431..e2f78a1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ 3. **DataInspector**,数据文件查看、编辑、转换工具 4. **QuantBox行情数据存储方案**,文件格式设计思路 5. **Data**,行情示例文件 -6. **SelfDecode**,.pd0/.7z子解压程序.解压当前目录以及子目录下的数据,到csv文件.默认解压到当前目录的SelfDecodeData下面 +6. **SelfDecode**,.pd0/.7z自解压程序(没有拓展名的文件,按.pd0文件处理).解压当前目录以及子目录下的数据,到csv文件.默认解压到当前目录的SelfDecodeData下面 ## 在自己的项目中使用 引用**QuantBox\.Data\.Serializer**库即可,参考**DataInspector**中的使用方法,再转换成自己系统中的数据格式
From 168ad6695aadbd89928a830402031adc67d37fe7 Mon Sep 17 00:00:00 2001 From: William Fouvy Date: Sun, 26 Jul 2015 18:31:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=B2=A1=E6=8B=93=E5=B1=95=E5=90=8D?= =?UTF-8?q?=E8=A7=A3=E5=8E=8B=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SelfDecode/Program.cs | 15 ++++++++++++++- SelfDecode/SelfDecode.csproj | 2 +- Test/Test.csproj | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/SelfDecode/Program.cs b/SelfDecode/Program.cs index 9730600..0259256 100644 --- a/SelfDecode/Program.cs +++ b/SelfDecode/Program.cs @@ -31,6 +31,7 @@ private static void ReadDirectorys(string pathChosen) { string filename = Path.GetFileName(file); string[] fe = filename.Split('.'); + // 没有拓展名的,直接尝试解压 if(fe.Length == 1) { Console.WriteLine("File: OK, {0}", file); @@ -94,9 +95,21 @@ private static void SaveCSV(List listTickView, string fullPathFile) } } sw.WriteLine(data); + string aPx,aSz,bPx,bSz; // 写数据 foreach(var tickView in listTickView) { + if (tickView.DepthList == null) + { + aPx = ""; + aSz = ""; + bPx = ""; + bSz = ""; + } + else + { + aPx = String.Format{"{0}", } + } data = String.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11}", tickView.TradingDay, tickView.ActionDay, @@ -185,7 +198,7 @@ private static Tuple ReadToStream(string pathChosen) listFileNames.Add(extractor.ArchiveFileNames[i]); } - string fileName = "default"; + string fileName = listFileNames.Count == 0? "default" : listFileNames[0]; MemoryStream stream = new MemoryStream(); try diff --git a/SelfDecode/SelfDecode.csproj b/SelfDecode/SelfDecode.csproj index 9792036..974c8bb 100644 --- a/SelfDecode/SelfDecode.csproj +++ b/SelfDecode/SelfDecode.csproj @@ -17,7 +17,7 @@ true full false - ..\bin\Debug\ + ..\Data\ DEBUG;TRACE prompt 4 diff --git a/Test/Test.csproj b/Test/Test.csproj index 9f4e678..0115932 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -21,7 +21,7 @@ true full false - bin\Debug\ + ..\bin\Debug\ DEBUG;TRACE prompt 4 @@ -29,7 +29,7 @@ pdbonly true - bin\Release\ + ..\bin\Release\ TRACE prompt 4