• R/O
  • SSH
  • HTTPS

wheretrainbuild: Commit


Commit MetaInfo

Revision23 (tree)
Zeit2019-04-14 21:54:23
Autordangerouswoo

Log Message

タイムテーブル変更対応

Ändern Zusammenfassung

Diff

--- WhereTrainBuild/Dialog/BuildDialogTrainDialog.Designer.cs (revision 22)
+++ WhereTrainBuild/Dialog/BuildDialogTrainDialog.Designer.cs (revision 23)
@@ -47,11 +47,14 @@
4747 this.label3 = new System.Windows.Forms.Label();
4848 this.BuildBtn = new System.Windows.Forms.Button();
4949 this.DiaBtn = new System.Windows.Forms.Button();
50+ this.label4 = new System.Windows.Forms.Label();
51+ this.TimeTableCmb = new System.Windows.Forms.ComboBox();
52+ this.TimeTableSetBtn = new System.Windows.Forms.Button();
5053 this.SuspendLayout();
5154 //
5255 // SelectSetBtn
5356 //
54- this.SelectSetBtn.Location = new System.Drawing.Point(274, 28);
57+ this.SelectSetBtn.Location = new System.Drawing.Point(274, 57);
5558 this.SelectSetBtn.Name = "SelectSetBtn";
5659 this.SelectSetBtn.Size = new System.Drawing.Size(75, 23);
5760 this.SelectSetBtn.TabIndex = 16;
@@ -61,7 +64,7 @@
6164 //
6265 // DelLineBtn
6366 //
64- this.DelLineBtn.Location = new System.Drawing.Point(274, 200);
67+ this.DelLineBtn.Location = new System.Drawing.Point(274, 224);
6568 this.DelLineBtn.Name = "DelLineBtn";
6669 this.DelLineBtn.Size = new System.Drawing.Size(75, 23);
6770 this.DelLineBtn.TabIndex = 14;
@@ -71,19 +74,18 @@
7174 //
7275 // DelSetBtn
7376 //
74- this.DelSetBtn.Location = new System.Drawing.Point(274, 57);
77+ this.DelSetBtn.Location = new System.Drawing.Point(274, 86);
7578 this.DelSetBtn.Name = "DelSetBtn";
7679 this.DelSetBtn.Size = new System.Drawing.Size(75, 23);
7780 this.DelSetBtn.TabIndex = 15;
7881 this.DelSetBtn.Text = "削除";
7982 this.DelSetBtn.UseVisualStyleBackColor = true;
80- this.DelSetBtn.Visible = false;
8183 this.DelSetBtn.Click += new System.EventHandler(this.DelSetBtn_Click);
8284 //
8385 // label1
8486 //
8587 this.label1.AutoSize = true;
86- this.label1.Location = new System.Drawing.Point(12, 9);
88+ this.label1.Location = new System.Drawing.Point(12, 42);
8789 this.label1.Name = "label1";
8890 this.label1.Size = new System.Drawing.Size(65, 12);
8991 this.label1.TabIndex = 12;
@@ -92,7 +94,7 @@
9294 // LineLbl
9395 //
9496 this.LineLbl.AutoSize = true;
95- this.LineLbl.Location = new System.Drawing.Point(12, 92);
97+ this.LineLbl.Location = new System.Drawing.Point(12, 119);
9698 this.LineLbl.Name = "LineLbl";
9799 this.LineLbl.Size = new System.Drawing.Size(29, 12);
98100 this.LineLbl.TabIndex = 13;
@@ -102,7 +104,7 @@
102104 //
103105 this.LineSetListBox.FormattingEnabled = true;
104106 this.LineSetListBox.ItemHeight = 12;
105- this.LineSetListBox.Location = new System.Drawing.Point(12, 28);
107+ this.LineSetListBox.Location = new System.Drawing.Point(12, 57);
106108 this.LineSetListBox.Name = "LineSetListBox";
107109 this.LineSetListBox.Size = new System.Drawing.Size(234, 52);
108110 this.LineSetListBox.TabIndex = 10;
@@ -114,9 +116,9 @@
114116 | System.Windows.Forms.AnchorStyles.Left)));
115117 this.LineListBox.FormattingEnabled = true;
116118 this.LineListBox.ItemHeight = 12;
117- this.LineListBox.Location = new System.Drawing.Point(14, 110);
119+ this.LineListBox.Location = new System.Drawing.Point(14, 134);
118120 this.LineListBox.Name = "LineListBox";
119- this.LineListBox.Size = new System.Drawing.Size(232, 112);
121+ this.LineListBox.Size = new System.Drawing.Size(232, 124);
120122 this.LineListBox.TabIndex = 11;
121123 this.LineListBox.SelectedIndexChanged += new System.EventHandler(this.LineListBox_SelectedIndexChanged);
122124 //
@@ -129,7 +131,7 @@
129131 this.TrainListBox.ItemHeight = 12;
130132 this.TrainListBox.Location = new System.Drawing.Point(377, 28);
131133 this.TrainListBox.Name = "TrainListBox";
132- this.TrainListBox.Size = new System.Drawing.Size(222, 148);
134+ this.TrainListBox.Size = new System.Drawing.Size(222, 184);
133135 this.TrainListBox.TabIndex = 17;
134136 //
135137 // EditBtn
@@ -167,7 +169,7 @@
167169 //
168170 // EditLineBtn
169171 //
170- this.EditLineBtn.Location = new System.Drawing.Point(274, 110);
172+ this.EditLineBtn.Location = new System.Drawing.Point(274, 134);
171173 this.EditLineBtn.Name = "EditLineBtn";
172174 this.EditLineBtn.Size = new System.Drawing.Size(75, 23);
173175 this.EditLineBtn.TabIndex = 21;
@@ -186,7 +188,7 @@
186188 //
187189 // AddLineBtn
188190 //
189- this.AddLineBtn.Location = new System.Drawing.Point(274, 139);
191+ this.AddLineBtn.Location = new System.Drawing.Point(274, 163);
190192 this.AddLineBtn.Name = "AddLineBtn";
191193 this.AddLineBtn.Size = new System.Drawing.Size(75, 23);
192194 this.AddLineBtn.TabIndex = 23;
@@ -198,7 +200,7 @@
198200 //
199201 this.DiaSrcTxt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
200202 | System.Windows.Forms.AnchorStyles.Right)));
201- this.DiaSrcTxt.Location = new System.Drawing.Point(377, 209);
203+ this.DiaSrcTxt.Location = new System.Drawing.Point(377, 253);
202204 this.DiaSrcTxt.Name = "DiaSrcTxt";
203205 this.DiaSrcTxt.Size = new System.Drawing.Size(222, 19);
204206 this.DiaSrcTxt.TabIndex = 24;
@@ -207,7 +209,7 @@
207209 // FileSelectBtn
208210 //
209211 this.FileSelectBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
210- this.FileSelectBtn.Location = new System.Drawing.Point(605, 207);
212+ this.FileSelectBtn.Location = new System.Drawing.Point(605, 251);
211213 this.FileSelectBtn.Name = "FileSelectBtn";
212214 this.FileSelectBtn.Size = new System.Drawing.Size(28, 23);
213215 this.FileSelectBtn.TabIndex = 25;
@@ -219,7 +221,7 @@
219221 //
220222 this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
221223 this.label3.AutoSize = true;
222- this.label3.Location = new System.Drawing.Point(385, 194);
224+ this.label3.Location = new System.Drawing.Point(385, 238);
223225 this.label3.Name = "label3";
224226 this.label3.Size = new System.Drawing.Size(94, 12);
225227 this.label3.TabIndex = 26;
@@ -229,7 +231,7 @@
229231 //
230232 this.BuildBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
231233 this.BuildBtn.Enabled = false;
232- this.BuildBtn.Location = new System.Drawing.Point(639, 207);
234+ this.BuildBtn.Location = new System.Drawing.Point(639, 251);
233235 this.BuildBtn.Name = "BuildBtn";
234236 this.BuildBtn.Size = new System.Drawing.Size(63, 23);
235237 this.BuildBtn.TabIndex = 27;
@@ -239,7 +241,7 @@
239241 //
240242 // DiaBtn
241243 //
242- this.DiaBtn.Location = new System.Drawing.Point(274, 168);
244+ this.DiaBtn.Location = new System.Drawing.Point(274, 192);
243245 this.DiaBtn.Name = "DiaBtn";
244246 this.DiaBtn.Size = new System.Drawing.Size(75, 23);
245247 this.DiaBtn.TabIndex = 23;
@@ -247,11 +249,42 @@
247249 this.DiaBtn.UseVisualStyleBackColor = true;
248250 this.DiaBtn.Click += new System.EventHandler(this.DiaBtn_Click);
249251 //
252+ // label4
253+ //
254+ this.label4.AutoSize = true;
255+ this.label4.Location = new System.Drawing.Point(10, 9);
256+ this.label4.Name = "label4";
257+ this.label4.Size = new System.Drawing.Size(94, 12);
258+ this.label4.TabIndex = 28;
259+ this.label4.Text = "タイムテーブル種別";
260+ //
261+ // TimeTableCmb
262+ //
263+ this.TimeTableCmb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
264+ this.TimeTableCmb.FormattingEnabled = true;
265+ this.TimeTableCmb.Location = new System.Drawing.Point(125, 6);
266+ this.TimeTableCmb.Name = "TimeTableCmb";
267+ this.TimeTableCmb.Size = new System.Drawing.Size(121, 20);
268+ this.TimeTableCmb.TabIndex = 29;
269+ //
270+ // TimeTableSetBtn
271+ //
272+ this.TimeTableSetBtn.Location = new System.Drawing.Point(274, 6);
273+ this.TimeTableSetBtn.Name = "TimeTableSetBtn";
274+ this.TimeTableSetBtn.Size = new System.Drawing.Size(75, 23);
275+ this.TimeTableSetBtn.TabIndex = 30;
276+ this.TimeTableSetBtn.Text = "選択";
277+ this.TimeTableSetBtn.UseVisualStyleBackColor = true;
278+ this.TimeTableSetBtn.Click += new System.EventHandler(this.TimeTableSetBtn_Click);
279+ //
250280 // BuildDialogTrainDialog
251281 //
252282 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
253283 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
254- this.ClientSize = new System.Drawing.Size(714, 249);
284+ this.ClientSize = new System.Drawing.Size(714, 293);
285+ this.Controls.Add(this.TimeTableSetBtn);
286+ this.Controls.Add(this.TimeTableCmb);
287+ this.Controls.Add(this.label4);
255288 this.Controls.Add(this.BuildBtn);
256289 this.Controls.Add(this.label3);
257290 this.Controls.Add(this.FileSelectBtn);
@@ -303,5 +336,8 @@
303336 private System.Windows.Forms.Label label3;
304337 private System.Windows.Forms.Button BuildBtn;
305338 private System.Windows.Forms.Button DiaBtn;
339+ private System.Windows.Forms.Label label4;
340+ private System.Windows.Forms.ComboBox TimeTableCmb;
341+ private System.Windows.Forms.Button TimeTableSetBtn;
306342 }
307343 }
\ No newline at end of file
--- WhereTrainBuild/Dialog/BuildDialogTrainDialog.cs (revision 22)
+++ WhereTrainBuild/Dialog/BuildDialogTrainDialog.cs (revision 23)
@@ -48,10 +48,27 @@
4848 /// <param name="e"></param>
4949 private void BuildDialogTrainDialog_Load(object sender, EventArgs e)
5050 {
51+ RebuildTimeTableComboBox();
52+
53+ TimeTableCmb.SelectedItem = m_form.Factory.GetNetwork().SetKind;
54+
5155 RebuildLineSetListBox();
5256 }
5357
5458 /// <summary>
59+ /// タイムテーブルコンボ再構築
60+ /// </summary>
61+ protected void RebuildTimeTableComboBox()
62+ {
63+ TimeTableCmb.Items.Clear();
64+
65+ foreach( var tt in Enum.GetValues(typeof(TrainNetwork.SetKindType)) )
66+ {
67+ TimeTableCmb.Items.Add(tt);
68+ }
69+ }
70+
71+ /// <summary>
5572 /// ラインセットリストボックス再構築
5673 /// </summary>
5774 protected void RebuildLineSetListBox()
@@ -399,6 +416,15 @@
399416 }
400417
401418 /// <summary>
419+ /// 強制ロード
420+ /// </summary>
421+ protected void LoadAssembly()
422+ {
423+ var web = System.Web.HttpUtility.UrlEncode("web");
424+ var net = System.Net.HttpWebRequest.Create("http://localhost");
425+ }
426+
427+ /// <summary>
402428 /// 構築ボタン押下
403429 /// </summary>
404430 /// <param name="sender"></param>
@@ -405,6 +431,8 @@
405431 /// <param name="e"></param>
406432 private void BuildBtn_Click(object sender, EventArgs e)
407433 {
434+ LoadAssembly();
435+
408436 var buildlogic = new DynamicBuildLogic();
409437 if (buildlogic.BuildDaia(m_form.Factory as BaseFactory, DiaSrcTxt.Text, this) == false)
410438 {
@@ -434,5 +462,18 @@
434462 dlg.ShowDialog(this);
435463 }
436464 }
465+
466+ /// <summary>
467+ /// タイムテーブル種別選択ボタン押下
468+ /// </summary>
469+ /// <param name="sender"></param>
470+ /// <param name="e"></param>
471+ private void TimeTableSetBtn_Click(object sender, EventArgs e)
472+ {
473+ var val = (TrainNetwork.SetKindType)TimeTableCmb.SelectedItem;
474+ m_form.Factory.GetNetwork().SetKind = val;
475+
476+ RebuildLineSetListBox();
477+ }
437478 }
438479 }
--- WhereTrainBuild/Dialog/EditLineDialog.Designer.cs (revision 22)
+++ WhereTrainBuild/Dialog/EditLineDialog.Designer.cs (revision 23)
@@ -176,9 +176,6 @@
176176 //
177177 this.SetList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
178178 this.SetList.FormattingEnabled = true;
179- this.SetList.Items.AddRange(new object[] {
180- "平日",
181- "土日祝日"});
182179 this.SetList.Location = new System.Drawing.Point(224, 185);
183180 this.SetList.Name = "SetList";
184181 this.SetList.Size = new System.Drawing.Size(171, 46);
--- WhereTrainBuild/Dialog/EditLineDialog.cs (revision 22)
+++ WhereTrainBuild/Dialog/EditLineDialog.cs (revision 23)
@@ -363,8 +363,13 @@
363363 LineAddBtn.Text = "OK";
364364 }
365365
366- for( int iIdx=0; iIdx< SetList.Items.Count; iIdx++ )
366+ foreach( var lineset in m_form.Factory.GetNetwork().GetLineSetList() )
367367 {
368+ SetList.Items.Add(lineset);
369+ }
370+
371+ for ( int iIdx=0; iIdx< SetList.Items.Count; iIdx++ )
372+ {
368373 SetList.SetItemChecked(iIdx, true);
369374 }
370375 }
--- WhereTrainBuild/MapUtil/Data/DynamicBuildLogic.cs (revision 22)
+++ WhereTrainBuild/MapUtil/Data/DynamicBuildLogic.cs (revision 23)
@@ -203,7 +203,7 @@
203203 param.GenerateInMemory = true;
204204 param.IncludeDebugInformation = false;
205205
206- foreach( var dr in asmtbl)
206+ foreach ( var dr in asmtbl)
207207 {
208208 assemblyfiles.Add(dr.Value);
209209 }
--- WhereTrainBuild/MapUtil/Data/TrainNetwork.cs (revision 22)
+++ WhereTrainBuild/MapUtil/Data/TrainNetwork.cs (revision 23)
@@ -35,6 +35,42 @@
3535 }
3636
3737 /// <summary>
38+ /// セット種類型
39+ /// </summary>
40+ public enum SetKindType
41+ {
42+ 平日日祝日,
43+ 平日土日祝日
44+ }
45+
46+ /// <summary>
47+ /// セット種類
48+ /// </summary>
49+ protected SetKindType m_setkind = SetKindType.平日日祝日;
50+
51+ /// <summary>
52+ /// セット種類プロパティ
53+ /// </summary>
54+ public SetKindType SetKind
55+ {
56+ get
57+ {
58+ return m_setkind;
59+ }
60+ set
61+ {
62+ var oldvalue = m_setkind;
63+
64+ m_setkind = value;
65+
66+ if(oldvalue != m_setkind)
67+ {
68+ RebuildSetTable();
69+ }
70+ }
71+ }
72+
73+ /// <summary>
3874 /// 経路リスト
3975 /// </summary>
4076 protected List<TrainPath> m_pathlist = new List<TrainPath>();
@@ -73,6 +109,30 @@
73109 }
74110
75111 /// <summary>
112+ /// ラインセットテーブル再構築
113+ /// </summary>
114+ protected void RebuildSetTable()
115+ {
116+ switch (SetKind)
117+ {
118+ case SetKindType.平日土日祝日:
119+ {
120+ m_linelist = GetLineList("平日");
121+ GetLineList("土曜");
122+ GetLineList("日祝日");
123+ }
124+ break;
125+
126+ default:
127+ {
128+ m_linelist = GetLineList("平日");
129+ GetLineList("土日祝日");
130+ }
131+ break;
132+ }
133+ }
134+
135+ /// <summary>
76136 /// ラインセット名変更
77137 /// </summary>
78138 /// <param name="setname">セット名</param>
@@ -483,6 +543,8 @@
483543 {
484544 var mynode = doc.CreateElement("TrainNetwork");
485545
546+ mynode.SetAttribute("SetKind", SetKind.ToString());
547+
486548 var pathlistnode = doc.CreateElement("PathList");
487549 mynode.AppendChild(pathlistnode);
488550 foreach (var path in m_pathlist)
@@ -514,6 +576,12 @@
514576 if (mynode.Name != "TrainNetwork")
515577 return false;
516578
579+ var setkindattr = mynode.Attributes["SetKind"];
580+ if(setkindattr != null)
581+ {
582+ SetKind = (SetKindType)Enum.Parse(typeof(SetKindType), setkindattr.Value);
583+ }
584+
517585 foreach (XmlNode childnode in mynode.ChildNodes)
518586 {
519587 if (childnode.Name == "PathList")
--- WhereTrainBuild/Net/ekijp.cs (revision 22)
+++ WhereTrainBuild/Net/ekijp.cs (revision 23)
@@ -107,14 +107,6 @@
107107 }
108108
109109 return table;
110-
111-/*
112- *
113- *
114- MemoryStream memst = new MemoryStream();
115- res.GetResponseStream().CopyTo(memst);
116- DebugOut(memst);
117- */
118110 }
119111
120112 /// <summary>
--- WhereTrainBuild/Properties/Resources.Designer.cs (revision 22)
+++ WhereTrainBuild/Properties/Resources.Designer.cs (revision 23)
@@ -47,7 +47,7 @@
4747 }
4848
4949 /// <summary>
50- /// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
50+ /// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
5151 /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
5252 /// </summary>
5353 [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
--- WhereTrainBuild/Properties/Settings.Designer.cs (revision 22)
+++ WhereTrainBuild/Properties/Settings.Designer.cs (revision 23)
@@ -12,7 +12,7 @@
1212
1313
1414 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
15+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
1616 internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
1717
1818 private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
Show on old repository browser