Default values for saved files, formatting of code internally and in tesxt header (gen. texts)
This commit is contained in:
@ -834,7 +834,7 @@ namespace CobXmlSupport
|
|||||||
savedFile SF = new savedFile();
|
savedFile SF = new savedFile();
|
||||||
SF.idConnect = "A472C801-2A7A-4A09-B432-8F16504964C3";
|
SF.idConnect = "A472C801-2A7A-4A09-B432-8F16504964C3";
|
||||||
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Init";
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Init";
|
||||||
SF.fNameSaved = "Init_" + S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".cbl";
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Init.cbl";
|
||||||
genCode.SavedFile = SF;
|
genCode.SavedFile = SF;
|
||||||
|
|
||||||
|
|
||||||
@ -891,7 +891,7 @@ namespace CobXmlSupport
|
|||||||
savedFile SF = new savedFile();
|
savedFile SF = new savedFile();
|
||||||
SF.idConnect = "15E1040B-2206-4F02-8212-FE9DF6B209B8";
|
SF.idConnect = "15E1040B-2206-4F02-8212-FE9DF6B209B8";
|
||||||
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Init";
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Init";
|
||||||
SF.fNameSaved = "Init_" + S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".cbl";
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Init.cbl";
|
||||||
genCode.SavedFile = SF;
|
genCode.SavedFile = SF;
|
||||||
|
|
||||||
string inFile = cmbLastFile.Text.Substring(cmbLastFile.Text.LastIndexOf("\\") + 1);
|
string inFile = cmbLastFile.Text.Substring(cmbLastFile.Text.LastIndexOf("\\") + 1);
|
||||||
@ -1101,6 +1101,7 @@ namespace CobXmlSupport
|
|||||||
public void CreateComment(TextBox outView, string typeComm, string Author, string Firm, string sourceFile = "", bool showJson = false)
|
public void CreateComment(TextBox outView, string typeComm, string Author, string Firm, string sourceFile = "", bool showJson = false)
|
||||||
{
|
{
|
||||||
outView.Text = " *----------------------------------------------------------------*";
|
outView.Text = " *----------------------------------------------------------------*";
|
||||||
|
string part1 = string.Empty, part2 = string.Empty;
|
||||||
centeredComment(outView, typeComm.ToUpper());
|
centeredComment(outView, typeComm.ToUpper());
|
||||||
if (sourceFile.Length > 0)
|
if (sourceFile.Length > 0)
|
||||||
{
|
{
|
||||||
@ -1113,13 +1114,26 @@ namespace CobXmlSupport
|
|||||||
outView.Text += "\r\n * Company : " + Firm.PadRight(51) + "*";
|
outView.Text += "\r\n * Company : " + Firm.PadRight(51) + "*";
|
||||||
if (showJson)
|
if (showJson)
|
||||||
{
|
{
|
||||||
outView.Text += "\r\n * Json-pth : " + Cc.jsonPathId.PadRight(51) + "*";
|
if (Cc.jsonPathId.PadRight(51).Length > 51)
|
||||||
|
{
|
||||||
|
MapSplit(Cc.jsonPathId, 51, out part1, out part2);
|
||||||
|
outView.Text += "\r\n * Json-path: " + part1.PadRight(51) + "*";
|
||||||
|
outView.Text += "\r\n * --> : " + part2.PadRight(51) + "*";
|
||||||
|
}
|
||||||
|
else outView.Text += "\r\n * Json-pth : " + Cc.jsonPathId.PadRight(51) + "*";
|
||||||
outView.Text += "\r\n * Json-in : " + Cc.CcFileInId.PadRight(51) + "*";
|
outView.Text += "\r\n * Json-in : " + Cc.CcFileInId.PadRight(51) + "*";
|
||||||
outView.Text += "\r\n * Json-Out : " + Cc.CcFileOutId.PadRight(51) + "*";
|
outView.Text += "\r\n * Json-Out : " + Cc.CcFileOutId.PadRight(51) + "*";
|
||||||
}
|
}
|
||||||
outView.Text += "\r\n *----------------------------------------------------------------*";
|
outView.Text += "\r\n *----------------------------------------------------------------*";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void MapSplit(string inStr, int chrs, out string prt1, out string prt2)
|
||||||
|
{
|
||||||
|
int locLen = inStr.Substring(0, chrs).LastIndexOf("\\");
|
||||||
|
prt1 = inStr.Substring(0, locLen);
|
||||||
|
prt2 = inStr.Substring(locLen);
|
||||||
|
}
|
||||||
|
|
||||||
private static void centeredComment(TextBox outView, string centeredText)
|
private static void centeredComment(TextBox outView, string centeredText)
|
||||||
{
|
{
|
||||||
int marg = (64 - centeredText.Length);
|
int marg = (64 - centeredText.Length);
|
||||||
@ -1185,7 +1199,11 @@ namespace CobXmlSupport
|
|||||||
{
|
{
|
||||||
if (!chkDisplays.Checked)
|
if (!chkDisplays.Checked)
|
||||||
{
|
{
|
||||||
createXMLMoveCode(true);
|
savedFile SF = new savedFile();
|
||||||
|
SF.idConnect = "598A5F20-9A8A-415D-81B2-BBFE04465381";
|
||||||
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Unload";
|
||||||
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Unload.cbl";
|
||||||
|
createXMLMoveCode(SF,true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1428,7 +1446,7 @@ namespace CobXmlSupport
|
|||||||
savedFile SF = new savedFile();
|
savedFile SF = new savedFile();
|
||||||
SF.idConnect = "6EFF8B31-7F88-4A81-B94E-41D54A3D3197";
|
SF.idConnect = "6EFF8B31-7F88-4A81-B94E-41D54A3D3197";
|
||||||
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Load";
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Load";
|
||||||
SF.fNameSaved = "Load_" + S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".cbl";
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Load.cbl";
|
||||||
genMoves.SavedFile = SF;
|
genMoves.SavedFile = SF;
|
||||||
|
|
||||||
foreach (CobRow cr in rowList)
|
foreach (CobRow cr in rowList)
|
||||||
@ -1477,7 +1495,7 @@ namespace CobXmlSupport
|
|||||||
savedFile SF = new savedFile();
|
savedFile SF = new savedFile();
|
||||||
SF.idConnect = "6EFF8B31-7F88-4A81-B94E-41D54A3D3197";
|
SF.idConnect = "6EFF8B31-7F88-4A81-B94E-41D54A3D3197";
|
||||||
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Load";
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Load";
|
||||||
SF.fNameSaved = "Load_" + S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".cbl";
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Load.cbl";
|
||||||
genExtMoves.SavedFile = SF;
|
genExtMoves.SavedFile = SF;
|
||||||
|
|
||||||
bool adj = false;
|
bool adj = false;
|
||||||
@ -1722,7 +1740,7 @@ namespace CobXmlSupport
|
|||||||
savedFile SF = new savedFile();
|
savedFile SF = new savedFile();
|
||||||
SF.idConnect = "9C3E8CC7-FA20-4E11-8E81-73BE8D2E9CFB";
|
SF.idConnect = "9C3E8CC7-FA20-4E11-8E81-73BE8D2E9CFB";
|
||||||
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Unload";
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Unload";
|
||||||
SF.fNameSaved = "Unload_" + S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".cbl";
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Unload.cbl";
|
||||||
fromMoves.SavedFile = SF;
|
fromMoves.SavedFile = SF;
|
||||||
|
|
||||||
bool adj = false;
|
bool adj = false;
|
||||||
@ -1900,7 +1918,7 @@ namespace CobXmlSupport
|
|||||||
savedFile SF = new savedFile();
|
savedFile SF = new savedFile();
|
||||||
SF.idConnect = "0A975654-75C6-4A8C-8534-AA16F46BC740";
|
SF.idConnect = "0A975654-75C6-4A8C-8534-AA16F46BC740";
|
||||||
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Transfer";
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Transfer";
|
||||||
SF.fNameSaved = "Transfer_" + S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".cbl";
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Transfer.cbl";
|
||||||
fromMoves.SavedFile = SF;
|
fromMoves.SavedFile = SF;
|
||||||
|
|
||||||
bool adj = false;
|
bool adj = false;
|
||||||
@ -2144,19 +2162,24 @@ namespace CobXmlSupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void createXMLMoveCode(bool justOut = false)
|
private void createXMLMoveCode(savedFile SF, bool justOut = false)
|
||||||
{
|
{
|
||||||
bool loopTyp = false;
|
bool loopTyp = false;
|
||||||
|
|
||||||
//Create showing window
|
//Create showing window
|
||||||
fromToMoves = new ShowCode();
|
fromToMoves = new ShowCode();
|
||||||
fromToMoves.Parent = this;
|
fromToMoves.Parent = this;
|
||||||
fromToMoves.Labeltext = "Created \"move From \" Code";
|
if (!justOut)
|
||||||
|
{
|
||||||
|
fromToMoves.Labeltext = "Created \"move From To\" Code";
|
||||||
|
}
|
||||||
|
else fromToMoves.Labeltext = "Created \"move From \" Code";
|
||||||
|
|
||||||
savedFile SF = new savedFile();
|
|
||||||
SF.idConnect = "598A5F20-9A8A-415D-81B2-BBFE04465381";
|
//savedFile SF = new savedFile();
|
||||||
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Unload";
|
//SF.idConnect = "598A5F20-9A8A-415D-81B2-BBFE04465381";
|
||||||
SF.fNameSaved = "Unload_" + S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".cbl";
|
//SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Unload";
|
||||||
|
//SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Unload.cbl";
|
||||||
fromToMoves.SavedFile = SF;
|
fromToMoves.SavedFile = SF;
|
||||||
|
|
||||||
|
|
||||||
@ -2207,7 +2230,8 @@ namespace CobXmlSupport
|
|||||||
{
|
{
|
||||||
//Before perform varying, move the count-value from old structure to new
|
//Before perform varying, move the count-value from old structure to new
|
||||||
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.qualCobRow.CountIn + "\r\n" + tmpQfh.indexRedText;
|
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.qualCobRow.CountIn + "\r\n" + tmpQfh.indexRedText;
|
||||||
fromToMoves.CodeShower.Text += " TO " + tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n" + tmpQfh.indexRedText;
|
fromToMoves.CodeShower.Text += " TO " +
|
||||||
|
tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n" + tmpQfh.indexRedText;
|
||||||
}
|
}
|
||||||
//Perform
|
//Perform
|
||||||
fromToMoves.CodeShower.Text += " PERFORM VARYING " + indTxt + " FROM 1 BY 1\r\n UNTIL " +
|
fromToMoves.CodeShower.Text += " PERFORM VARYING " + indTxt + " FROM 1 BY 1\r\n UNTIL " +
|
||||||
@ -2221,8 +2245,10 @@ namespace CobXmlSupport
|
|||||||
{
|
{
|
||||||
//when xml-record-field with occurs, the last index shall not be used (then use tmpQfh.indexRedText instead of tmpQfh.indexText
|
//when xml-record-field with occurs, the last index shall not be used (then use tmpQfh.indexRedText instead of tmpQfh.indexText
|
||||||
loopTyp = tmpQfh.qualCobRow.isOccurs;
|
loopTyp = tmpQfh.qualCobRow.isOccurs;
|
||||||
fromToMoves.CodeShower.Text += " IF " + tmpQfh.qualCobRow.CountIn.ToString() + "\r\n" + (string)(loopTyp ? tmpQfh.indexRedText : tmpQfh.indexText) + " > 0 \r\n";
|
fromToMoves.CodeShower.Text += " IF " + tmpQfh.qualCobRow.CountIn.ToString() + "\r\n" +
|
||||||
|
(string)(loopTyp ? tmpQfh.indexRedText : tmpQfh.indexText) + " > 0 \r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
//The acutal move of present fields
|
//The acutal move of present fields
|
||||||
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.ToString();
|
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.ToString();
|
||||||
if (!justOut)
|
if (!justOut)
|
||||||
@ -2236,7 +2262,8 @@ namespace CobXmlSupport
|
|||||||
if (tmpQfh.qualCobRow.MoveFromCode.IndexOf("<?>") > -1 || tmpQfh.qualCobRow.MoveFromCode.IndexOf("<NYPOST>") > -1)
|
if (tmpQfh.qualCobRow.MoveFromCode.IndexOf("<?>") > -1 || tmpQfh.qualCobRow.MoveFromCode.IndexOf("<NYPOST>") > -1)
|
||||||
{
|
{
|
||||||
fromToMoves.CodeShower.Text += " *>" + tmpQfh.qualCobRow.MoveFromCode + "\r\n";
|
fromToMoves.CodeShower.Text += " *>" + tmpQfh.qualCobRow.MoveFromCode + "\r\n";
|
||||||
fromToMoves.CodeShower.Text += " TO " + (string)(tmpQfh.qualCobRow.FieldDef.ToUpper().Contains("X") ? "MoveToStringVar" : "MoveToNumVar") + "\r\n";
|
fromToMoves.CodeShower.Text += " TO " +
|
||||||
|
(string)(tmpQfh.qualCobRow.FieldDef.ToUpper().Contains("X") ? "MoveToStringVar" : "MoveToNumVar") + "\r\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2245,7 +2272,8 @@ namespace CobXmlSupport
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fromToMoves.CodeShower.Text += " TO " + (string)(tmpQfh.qualCobRow.FieldDef.ToUpper().Contains("X") ? "MoveToStringVar" : "MoveToNumVar") + "\r\n";
|
fromToMoves.CodeShower.Text += " TO " +
|
||||||
|
(string)(tmpQfh.qualCobRow.FieldDef.ToUpper().Contains("X") ? "MoveToStringVar" : "MoveToNumVar") + "\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2254,10 +2282,15 @@ namespace CobXmlSupport
|
|||||||
if (tmpQfh.qualCobRow.FieldName.ToUpper().Contains("_VALUE")) { }
|
if (tmpQfh.qualCobRow.FieldName.ToUpper().Contains("_VALUE")) { }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.qualCobRow.CountIn + "\r\n" + (string)(loopTyp ? tmpQfh.indexRedText : tmpQfh.indexText);
|
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.qualCobRow.CountIn + "\r\n" +
|
||||||
fromToMoves.CodeShower.Text += " TO " + tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n" + (string)(loopTyp ? tmpQfh.indexRedText : tmpQfh.indexText);
|
(string)(loopTyp ? tmpQfh.indexRedText : tmpQfh.indexText);
|
||||||
|
fromToMoves.CodeShower.Text += " TO " +
|
||||||
|
tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n" +
|
||||||
|
(string)(loopTyp ? tmpQfh.indexRedText : tmpQfh.indexText);
|
||||||
fromToMoves.CodeShower.Text += " ELSE\r\n";
|
fromToMoves.CodeShower.Text += " ELSE\r\n";
|
||||||
fromToMoves.CodeShower.Text += " MOVE 0 TO " + tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n" + (string)(loopTyp ? tmpQfh.indexRedText : tmpQfh.indexText);
|
fromToMoves.CodeShower.Text += " MOVE 0 TO " +
|
||||||
|
tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n" +
|
||||||
|
(string)(loopTyp ? tmpQfh.indexRedText : tmpQfh.indexText);
|
||||||
fromToMoves.CodeShower.Text += " END-IF\r\n";
|
fromToMoves.CodeShower.Text += " END-IF\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2283,7 +2316,11 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
private void btnFrXMLTo_Click(object sender, EventArgs e)
|
private void btnFrXMLTo_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
createXMLMoveCode();
|
savedFile SF = new savedFile();
|
||||||
|
SF.idConnect = "598A5F20-9A8A-415D-81B2-BBFE04465381";
|
||||||
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Transfer";
|
||||||
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Transfer.cbl";
|
||||||
|
createXMLMoveCode(SF);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnTestThings_Click(object sender, EventArgs e)
|
private void btnTestThings_Click(object sender, EventArgs e)
|
||||||
@ -2331,8 +2368,8 @@ namespace CobXmlSupport
|
|||||||
SaveRegCopyFile srcf = new SaveRegCopyFile();
|
SaveRegCopyFile srcf = new SaveRegCopyFile();
|
||||||
savedFile localSaver = new savedFile();
|
savedFile localSaver = new savedFile();
|
||||||
localSaver.idConnect = "4B0E5C02-B2D0-4755-B4EC-AF449D513582";
|
localSaver.idConnect = "4B0E5C02-B2D0-4755-B4EC-AF449D513582";
|
||||||
localSaver.usageName = "XMLCOBfrom_"+S.ettingActualFile;
|
localSaver.usageName = S.ettingActualFile + "_XMLCOBfrom";
|
||||||
localSaver.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_COBXML.cpy";
|
localSaver.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".cpy";
|
||||||
srcf.SavedFile = localSaver;
|
srcf.SavedFile = localSaver;
|
||||||
srcf.FileData = this.outCob.Text;
|
srcf.FileData = this.outCob.Text;
|
||||||
srcf.ShowDialog();
|
srcf.ShowDialog();
|
||||||
@ -2358,9 +2395,8 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
savedFile SF = new savedFile();
|
savedFile SF = new savedFile();
|
||||||
SF.idConnect = "1C1FAE9D-39DD-4A24-A6C2-8696EAE3CB32";
|
SF.idConnect = "1C1FAE9D-39DD-4A24-A6C2-8696EAE3CB32";
|
||||||
SF.usageName = "";
|
|
||||||
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Crossref";
|
SF.usageName = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Crossref";
|
||||||
SF.fNameSaved = "Crossref_" + S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + ".txt";
|
SF.fNameSaved = S.ettingActualFile.Substring(0, S.ettingActualFile.LastIndexOf(".")) + "_Crossref.txt";
|
||||||
|
|
||||||
fromToMoves.SavedFile = SF;
|
fromToMoves.SavedFile = SF;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user