Преглед на файлове

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

gsp преди 1 година
родител
ревизия
3216f81789

+ 1 - 1
OTSCPP/OTSClassifyEngine/ExpressionParseEngine/ParticleSTDDB.cpp

@@ -75,7 +75,7 @@ namespace OTSClassifyEngine
 		ASSERT(query);
 		int cols = query->GetColCount();
 		int defineCols =(int) CParticleSTDTable::ColumnID::MAX -(int) CParticleSTDTable::ColumnID::MIN;
-		if (cols != defineCols)
+		if (cols != defineCols+1+4)
 		{
 			LogErrorTrace(__FILE__, __LINE__, _T("std db version is not match!"));
 			return NULL;

+ 15 - 0
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -15,6 +15,7 @@ using OTSCLRINTERFACE;
 using OTSMeasureApp._0_OTSModel.OTSDataType;
 using System.Windows.Forms;
 using System.Data;
+using System.IO;
 
 namespace OTSModelSharp
 {
@@ -805,6 +806,20 @@ namespace OTSModelSharp
             MsgSmplEnd.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.SUCCESSED;
             MsgSmplEnd.STMSampleStu.cSampleName = theSample.GetName();
             m_pMsrThread.SendMessageToMeasureApp(MsgSmplEnd);
+
+            string userdB = m_Sample.GetMsrParams().GetSTDName();
+            if(userdB.ToLower() != "nostddb" && userdB.ToLower() != "nostddb.db")
+            {
+                try
+                {
+                    string userdBpath= Application.StartupPath + "\\Config\\SysData\\" + m_Sample.GetMsrParams().GetSTDName() + ".db";
+                    File.Copy(userdBpath, m_pSampleRstFile.GetFieldFileSubFolderStr().Remove(m_pSampleRstFile.GetFieldFileSubFolderStr().IndexOf("FIELD_FILES")) + m_Sample.GetMsrParams().GetSTDName() + ".db", true);
+                }
+                catch(Exception ex)
+                {
+                    MessageBox.Show("userdB copy failed:" + ex.ToString());
+                }
+            }
         }
 
         public bool DoMEasureForReMeasure()

+ 7 - 6
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -218,7 +218,8 @@
       <EmbedInteropTypes>True</EmbedInteropTypes>
       <HintPath>..\OpenDll\WordApiDll\office.dll</HintPath>
     </Reference>
-    <Reference Include="OINA.Extender">
+    <Reference Include="OINA.Extender, Version=6.1.0.0, Culture=neutral, PublicKeyToken=5efad68c95e0364e, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
       <HintPath>..\OpenDll\OxfordApi61Dll\OINA.Extender.dll</HintPath>
       <Private>False</Private>
     </Reference>
@@ -231,6 +232,11 @@
       <HintPath>..\OpenDll\WordApiDll\OTS.WinFormsUI.Docking.dll</HintPath>
       <Private>False</Private>
     </Reference>
+    <Reference Include="OxfordExtenderWrapper, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Bin\x64\Release_oxford61\OxfordExtender\OxfordExtenderWrapper.exe</HintPath>
+      <Private>False</Private>
+    </Reference>
     <Reference Include="SlmRuntimeCSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\OpenDll\SlmRuntimeCSharp\SlmRuntimeCSharp.dll</HintPath>
@@ -945,11 +951,6 @@
       <Name>OTSClrInterface</Name>
       <Private>False</Private>
     </ProjectReference>
-    <ProjectReference Include="..\OxfordExtenderWrapper\OxfordExtenderWrapper.csproj">
-      <Project>{b2683648-c829-40e7-a479-ac90b1b80286}</Project>
-      <Name>OxfordExtenderWrapper</Name>
-      <Private>False</Private>
-    </ProjectReference>
   </ItemGroup>
   <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 14 - 11
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -167,20 +167,14 @@ namespace OTSIncAReportGrids
             ReportFun = new OTSImageDisHelp(resultFile);
 
             string sou = m_condition.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
-            if (!sou.Contains("+"))
+            if (sou.Contains("+"))
             {
+                MessageBox.Show("This function does not support multiple samples!");
                 result = m_ReportApp.m_rstDataMgr.ResultFilesList[0];
             }
             else
             {
-                for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
-                {
-                    if (sou == m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName_real.ToString())
-                    {
-                        result = m_ReportApp.m_rstDataMgr.ResultFilesList[i];
-                    }
-
-                }
+                result = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)];
             }
 
 
@@ -197,6 +191,10 @@ namespace OTSIncAReportGrids
         }
         bool Init()
         {
+            if(result==null)
+            {
+                return false;
+            }
             try
             {
                 lan = new Language(this);
@@ -212,7 +210,7 @@ namespace OTSIncAReportGrids
                 if (systype == OTSCommon.Model.OTS_SysType_ID.CleannessA)
                 {
                     string str_libraryName = result.GetSTDName();
-                    userLibrary = new UserLibraryData(str_libraryName);
+                    userLibrary = new UserLibraryData(str_libraryName,result.FilePath+"\\");
                     if (userLibrary.GetSqlHelper() != null)
                     {
                         userLibraryData = userLibrary.GetSubAttributeFromDatabase();
@@ -1702,7 +1700,12 @@ namespace OTSIncAReportGrids
         /// </summary>
         public void SaveMarkParticleRectangleOnFieldFile(string str_resultPath, DataTable dataTable, out List<string> vs, out DataTable dt_FIeld)
         {
-            Init();
+            if(!Init())
+            {
+                vs = null;
+                dt_FIeld = null;
+                return;
+            }
 
             List<string> maxlength = new List<string>();
             for (int i = 0; i < dataTable.Rows.Count; i++)

+ 0 - 7
OTSIncAReportApp/1-UI/GBCalculate/Purity.cs

@@ -72,13 +72,6 @@ namespace OTSIncAReportApp._1_UI.GBCalculate
             tB_result.Text = "";this.Refresh();
             Cursor = Cursors.WaitCursor;
             rBx_process.Text = "";
-            //Clipboard.SetDataObject(Properties.Resources.PurityFormula, false);//将图像放入剪切板
-            //if (rBx_process.CanPaste(DataFormats.GetFormat(DataFormats.Bitmap)))//判断剪切板内是否是图像
-            //{
-            //    rBx_process.Paste();//粘贴剪切板的内容到控件中
-            //    Clipboard.SetDataObject(String.Empty, false);//清空剪切板
-            //}
-            //rBx_process.AppendText("\n\n");
 
             int index = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
             for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)

+ 25 - 1
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -707,7 +707,13 @@ namespace OTSIncAReportApp
                             m_ReportApp.m_TablesWindow.Activate();
                             break;
                         case CALCULATE_TABLE_TYPE.GB_Method1:
-                            //国标一
+                            var sou = m_ReportApp.m_conditionChoose.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+                            if (sou.Contains("+"))
+                            {
+                                MessageBox.Show("This function does not support multiple samples!");
+                                return;
+                            }
+                                //国标一
                             Cursor.Current = Cursors.WaitCursor;
 
                             int index = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
@@ -741,6 +747,12 @@ namespace OTSIncAReportApp
 
                             break;
                         case CALCULATE_TABLE_TYPE.GB_Method2:
+                            var sou1 = m_ReportApp.m_conditionChoose.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+                            if (sou1.Contains("+"))
+                            {
+                                MessageBox.Show("This function does not support multiple samples!");
+                                return;
+                            }
                             //国标二
                             Cursor.Current = Cursors.WaitCursor;
                             int index2 = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
@@ -770,6 +782,12 @@ namespace OTSIncAReportApp
                             m_ReportApp.m_TablesWindow.Activate();
                             break;
                         case CALCULATE_TABLE_TYPE.ASTM:
+                            var Val = m_ReportApp.m_conditionChoose.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+                            if (Val.Contains("+"))
+                            {
+                                MessageBox.Show("This function does not support multiple samples!");
+                                return;
+                            }
                             //美标
                             Cursor.Current = Cursors.WaitCursor;
 
@@ -800,6 +818,12 @@ namespace OTSIncAReportApp
                             m_ReportApp.m_TablesWindow.Activate();
                             break;
                         case CALCULATE_TABLE_TYPE.DIN:
+                            var ite = m_ReportApp.m_conditionChoose.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+                            if (ite.Contains("+"))
+                            {
+                                MessageBox.Show("This function does not support multiple samples!");
+                                return;
+                            }
                             //德标
                             Cursor.Current = Cursors.WaitCursor;
                             int index4 = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);

+ 18 - 1
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -177,7 +177,24 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             dt.Columns.Add("Hardness_detailed");
             
             
-            OTSCommon.SqLiteHelper sh = new OTSCommon.SqLiteHelper("data source='" + System.IO.Directory.GetCurrentDirectory()+ "\\Config\\SysData\\"+ str + ".db" + "'");
+            OTSCommon.SqLiteHelper sh = null;
+            string fullPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.CurResultFile.FilePath + str + ".db";
+            string fullPath2 = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + str + ".db";
+            if (System.IO.File.Exists(fullPath))
+            {
+                sh = new OTSCommon.SqLiteHelper ("data source='" + fullPath + "'");
+            }
+            else if (System.IO.File.Exists(fullPath2))
+            {
+                sh = new OTSCommon.SqLiteHelper("data source='" + fullPath2 + "'");
+            }
+            else
+            {
+                sh = null;
+                data = null;
+                return;
+            }
+
             DataTable dt_stl= sh.ExecuteQuery("select * from ClassifySTD");
             for (int i=0;i< dt_stl.Rows.Count;i++)
             {

+ 1 - 1
OTSIncAReportApp/1-UI/frmReMeasure.cs

@@ -467,7 +467,7 @@ namespace OTSIncAReportApp
             }
             string str_libraryName = ReportFun.resultFile.GetSTDName();
             DataTable userLibraryData = new DataTable();
-            UserLibraryData userLibrary = new UserLibraryData(str_libraryName);
+            UserLibraryData userLibrary = new UserLibraryData(str_libraryName, ReportFun.resultFile.FilePath+"\\");
             if (userLibrary.GetSqlHelper() != null)
             {
                 userLibraryData = userLibrary.GetSubAttributeFromDatabase();

+ 14 - 1
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -1240,9 +1240,16 @@ namespace OTSIncAReportApp
 
         private void ribbonOrbMenuItem_InclusionsTraceability_Click(object sender, EventArgs e)
         {
+            string sou = m_conditionChoose.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+            if(sou.Contains("+"))
+            {
+                MessageBox.Show("This function does not support multiple samples!");
+                return;
+            }
+            int index = m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
             try
             {
-                System.Diagnostics.Process p = System.Diagnostics.Process.Start(".\\OTSInclusionsTraceability.exe", "\""+ m_rstDataMgr.CurResultFile.FilePath+ "\"");
+                System.Diagnostics.Process p = System.Diagnostics.Process.Start(".\\OTSInclusionsTraceability.exe", "\""+ m_rstDataMgr.ResultFilesList[index].FilePath+ "\"");
                 p.WaitForExit();
             }
             catch (Exception ex)
@@ -1263,6 +1270,12 @@ namespace OTSIncAReportApp
 
         private void ribbonOrbMenuItem_purity_Click(object sender, EventArgs e)
         {
+            string sou = m_conditionChoose.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+            if (sou.Contains("+"))
+            {
+                MessageBox.Show("This function does not support multiple samples!");
+                return;
+            }
             try
             {
                 _1_UI.GBCalculate.Purity purity = new _1_UI.GBCalculate.Purity(this);

+ 8 - 3
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -792,22 +792,27 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
     {
         private SqlHelper dbHelper;
 
-        public UserLibraryData(string libraryName)
+        public UserLibraryData(string libraryName,string resultpath)
         {
             NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
             if (!libraryName.Contains(".db"))
             {
                 libraryName += ".db";
             }
-            string fullPath = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + libraryName;
+            string fullPath = resultpath + libraryName;
+            string fullPath2 = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + libraryName;
             if (System.IO.File.Exists(fullPath))
             {
                 dbHelper = new SqlHelper("data source='" + fullPath + "'");
             }
+            else if(System.IO.File.Exists(fullPath2))
+            {
+                dbHelper = new SqlHelper("data source='" + fullPath2 + "'");
+            }
             else
             {
                 dbHelper = null;
-                log.Error("Failed to load user-defined library_"+ fullPath+"!");
+                log.Error("Failed to load user-defined library"+ "!");
             }
         }
 

+ 5 - 5
OTSSysMgrApp/OTSSysMgrApp.csproj

@@ -173,6 +173,11 @@
       <HintPath>..\OpenDll\Nlog\NLog.dll</HintPath>
       <Private>False</Private>
     </Reference>
+    <Reference Include="OxfordExtenderWrapper, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Bin\x64\Release_oxford61\OxfordExtender\OxfordExtenderWrapper.exe</HintPath>
+      <Private>False</Private>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.configuration" />
     <Reference Include="System.Core" />
@@ -307,11 +312,6 @@
       <Name>OTSIncAMeasureApp</Name>
       <Private>False</Private>
     </ProjectReference>
-    <ProjectReference Include="..\OxfordExtenderWrapper\OxfordExtenderWrapper.csproj">
-      <Project>{b2683648-c829-40e7-a479-ac90b1b80286}</Project>
-      <Name>OxfordExtenderWrapper</Name>
-      <Private>False</Private>
-    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 2 - 1
OxfordExtenderWrapper/OxfordExtenderWrapper.csproj

@@ -39,9 +39,10 @@
       <HintPath>..\OpenDll\Nlog\NLog.dll</HintPath>
       <Private>False</Private>
     </Reference>
-    <Reference Include="OINA.Extender, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5efad68c95e0364e, processorArchitecture=MSIL">
+    <Reference Include="OINA.Extender, Version=6.1.0.0, Culture=neutral, PublicKeyToken=5efad68c95e0364e, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\OpenDll\OxfordApi61Dll\OINA.Extender.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />