Skip to content

Commit 68e3e70

Browse files
authored
Build 21.11.25.45
1 parent 7b93123 commit 68e3e70

File tree

7 files changed

+113
-31
lines changed

7 files changed

+113
-31
lines changed

Config.cs

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ public class Config
111111
public bool saveLineNodesShape = false;
112112
[ProtoMember(34)]
113113
public string sortAggTagsPriority = null;
114+
[ProtoMember(35)]
115+
public byte dbfMoreCompatible = 0; // 0,1 - yes, 2 - no
114116

115117
public PointF[] _in_polygon = null;
116118
public OSMDictionary osmDict = new OSMDictionary();

DBFWrites.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public class DBFWriter: FileStream
122122
private CodePageSet _cp = CodePageSet.Default;
123123
private FieldInfos _FieldInfos = new FieldInfos();
124124
public CodePageList CodePages = new CodePageList();
125+
private bool _tenHeaderMode = true;
125126

126127
private OSMPBFReader.MyBitConverter bc = new OSMPBFReader.MyBitConverter(true);
127128

@@ -155,6 +156,8 @@ public DBFWriter(string fileName, FileMode mode, byte dbfCodePage): base(fileNam
155156
WriteHeader();
156157
}
157158

159+
public bool ShortenFieldNameMode { get { return _tenHeaderMode; } set { _tenHeaderMode = value; } }
160+
158161
public byte FieldsCount
159162
{
160163
get
@@ -250,7 +253,8 @@ public void WriteHeader(FieldInfos fields)
250253
//
251254
buff = fields[i].BName(_cp.Encoding);
252255
if (fields[i].GName.Length > 11)
253-
buff[10] = (byte)(0x41 + (mhl++));
256+
buff[10] = (byte)(0x41 + (mhl++));
257+
if(_tenHeaderMode) buff[10] = 0;
254258
this.Write(buff, 0, buff.Length); // 0 - Field Name
255259
{
256260
for (int b = 0; b < buff.Length; b++)
@@ -546,6 +550,10 @@ public override void Close()
546550
fs.Write(buff, 0, buff.Length);
547551
buff = System.Text.Encoding.GetEncoding(1251).GetBytes("R_COUNT < R_SAVED - Âåðîÿòíåå âñåãî ëèíèÿ íå áûëà ýêñïîðòèðîâàíà (íàéäåíà)\r\n");
548552
fs.Write(buff, 0, buff.Length);
553+
buff = System.Text.Encoding.GetEncoding(1251).GetBytes("F.../L... - Èç íà÷àëà (F) èëè êîíöà (L) â ëèíèþ WAY_ID\r\n");
554+
fs.Write(buff, 0, buff.Length);
555+
buff = System.Text.Encoding.GetEncoding(1251).GetBytes("T...V... -  (T) ëèíèþ WAY_ID ÷åðåç (V) òî÷êó NODE_ID\r\n");
556+
fs.Write(buff, 0, buff.Length);
549557
//R_COUNT <> R_SAVED
550558
}
551559
else if (filename.IndexOf("[M") > 0)

MForm.Designer.cs

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MForm.cs

+29
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ public void config_onReloadProperties(object sender, EventArgs e)
258258
props.Items[36].SubItems[1].Text = config.addFisrtAndLastNodesLns2Memory ? "Äà" : "";
259259
props.Items[37].SubItems[1].Text = config.saveLineNodesShape ? "Äà" : "";
260260
props.Items[38].SubItems[1].Text = String.IsNullOrEmpty(config.sortAggTagsPriority) ? "" : config.sortAggTagsPriority;
261+
props.Items[39].SubItems[1].Text = config.dbfMoreCompatible != 2 ? "Äà" : "Íåò";
261262

262263
if (!String.IsNullOrEmpty(config.scriptFilter))
263264
props.Items[19].SubItems[1].Text = config.scriptFilter.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries)[0];
@@ -2269,6 +2270,34 @@ private void SetProperty(int mode)
22692270
};
22702271
props.Items[38].SubItems[1].Text = config.sortAggTagsPriority;
22712272
};
2273+
////
2274+
if (index == 39)
2275+
{
2276+
string[] options = new string[] { "Äà", "Íåò" };
2277+
if (mode == 2)
2278+
{
2279+
config.dbfMoreCompatible = 1;
2280+
}
2281+
else if (mode == 0)
2282+
{
2283+
System.Windows.Forms.InputBox.defWidth = 182;
2284+
int val = config.dbfMoreCompatible == 2 ? 1 : 0;
2285+
if (InputBox.Show("DBF:", "Ðåæèì ïîâûøåííîé ñîâìåñòèìîñòè DBF ôàéëîâ (êîðîòêèå èìåíà ïîëåé):", options, ref val) == DialogResult.OK)
2286+
{
2287+
config.dbfMoreCompatible = (byte) (1 + val);
2288+
props.Items[39].SubItems[1].Text = config.dbfMoreCompatible != 2 ? "Äà" : "Íåò";
2289+
};
2290+
System.Windows.Forms.InputBox.defWidth = 310;
2291+
}
2292+
else
2293+
{
2294+
if (config.dbfMoreCompatible == 2)
2295+
config.dbfMoreCompatible = 1;
2296+
else
2297+
config.dbfMoreCompatible = 2;
2298+
};
2299+
props.Items[39].SubItems[1].Text = config.dbfMoreCompatible != 2 ? "Äà" : "Íåò";
2300+
};
22722301
//////////////////////////////
22732302
//////////////////////////////
22742303
//////////////////////////////

0 commit comments

Comments
 (0)