New implementation of move from to /to be continued !

This commit is contained in:
2014-12-04 16:50:58 +01:00
parent 11aa0ae9e7
commit 29d2057c01
4 changed files with 105 additions and 4 deletions

View File

@ -58,6 +58,7 @@
<DependentUpon>GenCobCode.cs</DependentUpon> <DependentUpon>GenCobCode.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="IndexState.cs" /> <Compile Include="IndexState.cs" />
<Compile Include="IndStatus.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="qualifieldhlp.cs" /> <Compile Include="qualifieldhlp.cs" />

View File

@ -1699,8 +1699,12 @@ namespace CobXmlSupport
} }
foreach (qualifieldhlp tmpQfh in qldList) foreach (qualifieldhlp tmpQfh in qldList)
{ {
fromToMoves.CodeShower.Text += tmpQfh.ToString(); if (tmpQfh.indexStrings != null)
fromToMoves.CodeShower.Text += tmpQfh.ToExpString(); {
}
fromToMoves.CodeShower.Text += "MOVE " + tmpQfh.ToString();
fromToMoves.CodeShower.Text += "TO " + tmpQfh.ToExpString();
} }
fromToMoves.Show(); fromToMoves.Show();

View File

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CobXmlSupport
{
public class IndStatus
{
private List<string> presentInds = null;
private int returns = 0;
private string[] newInds=null;
public IndStatus()
{
presentInds = new List<string>();
}
public void handleStatus(string[] new_Inds)
{
List<string> news = new List<string>();
news.AddRange(new_Inds);
foreach (string tmpStr in presentInds)
{
if (news.Contains(tmpStr)) { }
else {
returns += 1;
}
}
List<string> addedStrs = new List<string>();
foreach (string tmpInStr in new_Inds)
{
if (presentInds.Contains(tmpInStr)){}
else
{
presentInds.Add(tmpInStr);
addedStrs.Add(tmpInStr);
}
}
// Utveckling pågår !
}
}
}

View File

@ -11,7 +11,18 @@ namespace CobXmlSupport
private CobRow qualifiedRow; private CobRow qualifiedRow;
private List<CobRow> qualRows; private List<CobRow> qualRows;
private Dictionary<string, string> locIndexis; private Dictionary<string, string> locIndexis;
private string qfhCode; private string qfhCode, qfhInd ;
private string[] indexStrs;
public string indexText
{
get { return qfhInd; }
}
public string[] indexStrings
{
get { return indexStrs; }
}
public qualifieldhlp() public qualifieldhlp()
{ {
@ -44,13 +55,15 @@ namespace CobXmlSupport
if (qualRows.Count > 0) if (qualRows.Count > 0)
{ {
qfhCode = ""; qfhCode = "";
foreach (CobRow localCobRow in qualRows) foreach (CobRow localCobRow in qualRows)
{ {
if (qfhCode.Length > 0) if (qfhCode.Length > 0)
{ {
qfhCode += " OF "; qfhCode += " OF ";
} }
if (exp) qfhCode += localCobRow.FieldName.Replace(S.ettingPrefix,S.ettingExpPrefix); if (exp) qfhCode += localCobRow.FieldName.Replace(S.ettingPrefix, S.ettingExpPrefix);
else qfhCode += localCobRow.FieldName; else qfhCode += localCobRow.FieldName;
if (localCobRow.isOccurs) if (localCobRow.isOccurs)
{ {
@ -60,9 +73,40 @@ namespace CobXmlSupport
} }
qfhCode += "\r\n"; qfhCode += "\r\n";
} }
if (this.indexText.Length > 0)
{
qfhCode += this.indexText ;
}
} }
} }
private void initLocIndexTxt()
{
qfhInd = "";
indexStrs = null;
if (locIndexis!=null && locIndexis.Count > 0)
{
indexStrs=new string[locIndexis.Count];
int indCnt = 0;
foreach (KeyValuePair<string, string> tmpInd in locIndexis)
{
indexStrs[indCnt] = tmpInd.Value;
if (qfhInd.Length == 0)
{
qfhInd = "( " + tmpInd.Value;
}
else
{
qfhInd += ",\r\n" + tmpInd.Value;
}
}
qfhInd += " )\r\n";
}
}
private void initQualRows(ref Dictionary<string, string> allInds) private void initQualRows(ref Dictionary<string, string> allInds)
{ {
CobRow tmpRow = qualifiedRow; CobRow tmpRow = qualifiedRow;
@ -90,6 +134,7 @@ namespace CobXmlSupport
} }
else break; else break;
} }
initLocIndexTxt();
} }
public override string ToString() public override string ToString()