-
Notifications
You must be signed in to change notification settings - Fork 8
/
Editortable.cs
1371 lines (1258 loc) · 70.9 KB
/
Editortable.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.Drawing;
using System.Windows.Forms;
using DarkUI.Controls;
using DarkUI.Forms;
using System.Runtime.CompilerServices;
public class Editortable : DarkForm
{
private string vssUnits_0 = "KPH";
private Editortable Editortable_0;
private IContainer icontainer_0;
private IContainer icontainer_1;
public bool bool_0 = true;
public static float float_0 = 1f;
public static float[] float_1 = new float[2];
private DarkTreeView treeView1;
private DarkGroupBox groupBox1;
public DataGridView dataGridView_0;
internal ClassEditor ClassEditor_0;
public string LoadedFilename;
public bool IsFullBinary = true;
public static ImageList imageList_0;
private OpenFileDialog openFileDialog1;
private SaveFileDialog saveFileDialog1;
public GForm_Main GForm_Main_0;
private DarkToolStrip darkToolStrip1;
private ToolStripDropDownButton toolStripDropDownButton1;
private ToolStripMenuItem openbinToolStripMenuItem;
private ToolStripMenuItem savebinToolStripMenuItem;
private ToolStripMenuItem fixChecksumsToolStripMenuItem;
private ToolStripSeparator toolStripSeparator1;
private ToolStripMenuItem openDefinitionsFolderToolStripMenuItem;
private ToolStripDropDownButton toolStripDropDownButton2;
private ToolStripMenuItem undoToolStripMenuItem;
public ToolStripMenuItem redoToolStripMenuItem;
private ToolStripSeparator toolStripSeparator2;
private ToolStripMenuItem increaseSelectionToolStripMenuItem;
private SplitContainer splitContainer1;
private SplitContainer splitContainer2;
private DarkTextBox darkTextBox_0;
private ToolStripDropDownButton toolStripDropDownButton3;
private FolderBrowserDialog folderBrowserDialog1;
private ToolStripMenuItem removeBootloaderInbinToolStripMenuItem;
private ToolStripMenuItem convertrwdTobinToolStripMenuItem;
private ToolStripMenuItem convertbinTorwdToolStripMenuItem;
private ToolStripMenuItem openOBD2ScanToolToolStripMenuItem;
private ContextMenuStrip contextMenuStrip1;
private IContainer components;
private ToolStripMenuItem clearLogsToolStripMenuItem;
private ToolStripMenuItem loadReloadDefinitionToolStripMenuItem;
private ToolStripMenuItem decreaseSelectionToolStripMenuItem;
internal Editortable(ref GForm_Main GForm_Main_1)
{
GForm_Main_0 = GForm_Main_1;
this.InitializeComponent();
Editortable_0 = this;
if (this.ClassEditor_0 != null) this.ClassEditor_0 = null;
this.ClassEditor_0 = new ClassEditor(ref Editortable_0);
this.Text = "Honda&Acura Rom Tables Editor (" + this.GForm_Main_0.Version + ")";
}
public void Loadingg()
{
//string LastOpenFilePath = Application.StartupPath + @"\LastFileOpened.txt";
//if (File.Exists(LastOpenFilePath))
if (GForm_Main_0.LastFileOpenedEditor != "")
{
DialogResult result = DarkMessageBox.Show(this, "Do you want to reopen the last file you have worked on?", "Reopen last file used", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
if (result == DialogResult.Yes)
{
//LoadThisFile(File.ReadAllText(LastOpenFilePath));
LoadThisFile(GForm_Main_0.LastFileOpenedEditor);
}
}
}
public void method_Log(string string_3)
{
this.darkTextBox_0.Text += string_3;
//Console.Write(string_3);
}
public void method_1(string string_3)
{
try
{
//With newline automaticly added
//Console.WriteLine(string_3);
Editortable.Class5 @class = new Editortable.Class5();
@class.Editortable_0 = this;
@class.string_0 = string_3;
this.darkTextBox_0.BeginInvoke(new MethodInvoker(@class.method_0));
}
catch { }
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Editortable));
this.treeView1 = new DarkUI.Controls.DarkTreeView();
this.groupBox1 = new DarkUI.Controls.DarkGroupBox();
this.dataGridView_0 = new System.Windows.Forms.DataGridView();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.darkToolStrip1 = new DarkUI.Controls.DarkToolStrip();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.openbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.savebinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fixChecksumsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.loadReloadDefinitionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openDefinitionsFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton();
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.increaseSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.decreaseSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripDropDownButton3 = new System.Windows.Forms.ToolStripDropDownButton();
this.openOBD2ScanToolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.convertrwdTobinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.convertbinTorwdToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeBootloaderInbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.darkTextBox_0 = new DarkUI.Controls.DarkTextBox();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.clearLogsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_0)).BeginInit();
this.darkToolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// treeView1
//
this.treeView1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView1.EvenNodeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.treeView1.FocusedNodeColor = System.Drawing.Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(110)))), ((int)(((byte)(175)))));
this.treeView1.ImageIndex = 0;
this.treeView1.ImageList = null;
this.treeView1.Location = new System.Drawing.Point(0, 0);
this.treeView1.Margin = new System.Windows.Forms.Padding(2);
this.treeView1.MaxDragChange = 20;
this.treeView1.Name = "treeView1";
this.treeView1.NonFocusedNodeColor = System.Drawing.Color.FromArgb(((int)(((byte)(92)))), ((int)(((byte)(92)))), ((int)(((byte)(92)))));
this.treeView1.OddNodeColor = System.Drawing.Color.FromArgb(((int)(((byte)(57)))), ((int)(((byte)(60)))), ((int)(((byte)(62)))));
this.treeView1.SelectedImageIndex = 0;
this.treeView1.SelectWithArrowKeys = false;
this.treeView1.Size = new System.Drawing.Size(297, 517);
this.treeView1.TabIndex = 2;
this.treeView1.SelectedNodesChanged += new System.EventHandler(this.treeView1_AfterSelect);
//
// groupBox1
//
this.groupBox1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
this.groupBox1.Controls.Add(this.dataGridView_0);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
this.groupBox1.Size = new System.Drawing.Size(799, 361);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Table:";
//
// dataGridView_0
//
this.dataGridView_0.AllowUserToAddRows = false;
this.dataGridView_0.AllowUserToDeleteRows = false;
this.dataGridView_0.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
this.dataGridView_0.BackgroundColor = System.Drawing.SystemColors.ControlDarkDark;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView_0.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView_0.ColumnHeadersHeight = 20;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.ControlLight;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView_0.DefaultCellStyle = dataGridViewCellStyle2;
this.dataGridView_0.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView_0.EnableHeadersVisualStyles = false;
this.dataGridView_0.GridColor = System.Drawing.SystemColors.ControlDarkDark;
this.dataGridView_0.Location = new System.Drawing.Point(2, 15);
this.dataGridView_0.Margin = new System.Windows.Forms.Padding(2);
this.dataGridView_0.Name = "dataGridView_0";
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.ControlDarkDark;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView_0.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
this.dataGridView_0.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.dataGridView_0.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.dataGridView_0.RowTemplate.Height = 31;
this.dataGridView_0.Size = new System.Drawing.Size(795, 344);
this.dataGridView_0.TabIndex = 4;
this.dataGridView_0.TabStop = false;
this.dataGridView_0.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.CellValueChanged);
this.dataGridView_0.KeyDown += new System.Windows.Forms.KeyEventHandler(this.method_4);
//
// openFileDialog1
//
this.openFileDialog1.DefaultExt = "*.bin";
this.openFileDialog1.Filter = "Honda binary rom file|*.bin";
this.openFileDialog1.Title = "Open File";
//
// saveFileDialog1
//
this.saveFileDialog1.DefaultExt = "*.bin";
this.saveFileDialog1.Filter = "Honda binary file|*.bin";
this.saveFileDialog1.Title = "Save File";
//
// darkToolStrip1
//
this.darkToolStrip1.AutoSize = false;
this.darkToolStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.darkToolStrip1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.darkToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton1,
this.toolStripDropDownButton2,
this.toolStripDropDownButton3});
this.darkToolStrip1.Location = new System.Drawing.Point(0, 0);
this.darkToolStrip1.Name = "darkToolStrip1";
this.darkToolStrip1.Padding = new System.Windows.Forms.Padding(5, 0, 1, 0);
this.darkToolStrip1.Size = new System.Drawing.Size(1100, 28);
this.darkToolStrip1.TabIndex = 2;
this.darkToolStrip1.Text = "darkToolStrip1";
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openbinToolStripMenuItem,
this.savebinToolStripMenuItem,
this.fixChecksumsToolStripMenuItem,
this.toolStripSeparator1,
this.loadReloadDefinitionToolStripMenuItem,
this.openDefinitionsFolderToolStripMenuItem});
this.toolStripDropDownButton1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(38, 25);
this.toolStripDropDownButton1.Text = "File";
//
// openbinToolStripMenuItem
//
this.openbinToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.openbinToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.openbinToolStripMenuItem.Name = "openbinToolStripMenuItem";
this.openbinToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.openbinToolStripMenuItem.Text = "Open .bin";
this.openbinToolStripMenuItem.Click += new System.EventHandler(this.button1_Click);
//
// savebinToolStripMenuItem
//
this.savebinToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.savebinToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.savebinToolStripMenuItem.Name = "savebinToolStripMenuItem";
this.savebinToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.savebinToolStripMenuItem.Text = "Save .bin";
this.savebinToolStripMenuItem.Click += new System.EventHandler(this.button2_Click);
//
// fixChecksumsToolStripMenuItem
//
this.fixChecksumsToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.fixChecksumsToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.fixChecksumsToolStripMenuItem.Name = "fixChecksumsToolStripMenuItem";
this.fixChecksumsToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.fixChecksumsToolStripMenuItem.Text = "Fix Checksums";
this.fixChecksumsToolStripMenuItem.Click += new System.EventHandler(this.fixChecksumsToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.toolStripSeparator1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.toolStripSeparator1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1);
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(196, 6);
//
// loadReloadDefinitionToolStripMenuItem
//
this.loadReloadDefinitionToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.loadReloadDefinitionToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.loadReloadDefinitionToolStripMenuItem.Name = "loadReloadDefinitionToolStripMenuItem";
this.loadReloadDefinitionToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.loadReloadDefinitionToolStripMenuItem.Text = "Load/Reload Definition";
this.loadReloadDefinitionToolStripMenuItem.Click += new System.EventHandler(this.loadReloadDefinitionToolStripMenuItem_Click);
//
// openDefinitionsFolderToolStripMenuItem
//
this.openDefinitionsFolderToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.openDefinitionsFolderToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.openDefinitionsFolderToolStripMenuItem.Name = "openDefinitionsFolderToolStripMenuItem";
this.openDefinitionsFolderToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.openDefinitionsFolderToolStripMenuItem.Text = "Open Definitions Folder";
this.openDefinitionsFolderToolStripMenuItem.Click += new System.EventHandler(this.openDefinitionsFolderToolStripMenuItem_Click);
//
// toolStripDropDownButton2
//
this.toolStripDropDownButton2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.toolStripDropDownButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.undoToolStripMenuItem,
this.redoToolStripMenuItem,
this.toolStripSeparator2,
this.increaseSelectionToolStripMenuItem,
this.decreaseSelectionToolStripMenuItem});
this.toolStripDropDownButton2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.toolStripDropDownButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton2.Image")));
this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton2.Name = "toolStripDropDownButton2";
this.toolStripDropDownButton2.Size = new System.Drawing.Size(40, 25);
this.toolStripDropDownButton2.Text = "Edit";
//
// undoToolStripMenuItem
//
this.undoToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.undoToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
this.undoToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.undoToolStripMenuItem.Text = "Undo";
this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click);
//
// redoToolStripMenuItem
//
this.redoToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.redoToolStripMenuItem.Enabled = false;
this.redoToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153)))));
this.redoToolStripMenuItem.Name = "redoToolStripMenuItem";
this.redoToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.redoToolStripMenuItem.Text = "Redo";
this.redoToolStripMenuItem.Click += new System.EventHandler(this.redoToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.toolStripSeparator2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.toolStripSeparator2.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1);
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
//
// increaseSelectionToolStripMenuItem
//
this.increaseSelectionToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.increaseSelectionToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.increaseSelectionToolStripMenuItem.Name = "increaseSelectionToolStripMenuItem";
this.increaseSelectionToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.increaseSelectionToolStripMenuItem.Text = "Increase Selection";
this.increaseSelectionToolStripMenuItem.Click += new System.EventHandler(this.increaseSelectionToolStripMenuItem_Click);
//
// decreaseSelectionToolStripMenuItem
//
this.decreaseSelectionToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.decreaseSelectionToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.decreaseSelectionToolStripMenuItem.Name = "decreaseSelectionToolStripMenuItem";
this.decreaseSelectionToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.decreaseSelectionToolStripMenuItem.Text = "Decrease Selection";
this.decreaseSelectionToolStripMenuItem.Click += new System.EventHandler(this.decreaseSelectionToolStripMenuItem_Click);
//
// toolStripDropDownButton3
//
this.toolStripDropDownButton3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.toolStripDropDownButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openOBD2ScanToolToolStripMenuItem,
this.convertrwdTobinToolStripMenuItem,
this.convertbinTorwdToolStripMenuItem,
this.removeBootloaderInbinToolStripMenuItem});
this.toolStripDropDownButton3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.toolStripDropDownButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton3.Image")));
this.toolStripDropDownButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton3.Name = "toolStripDropDownButton3";
this.toolStripDropDownButton3.Size = new System.Drawing.Size(47, 25);
this.toolStripDropDownButton3.Text = "Tools";
//
// openOBD2ScanToolToolStripMenuItem
//
this.openOBD2ScanToolToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.openOBD2ScanToolToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.openOBD2ScanToolToolStripMenuItem.Name = "openOBD2ScanToolToolStripMenuItem";
this.openOBD2ScanToolToolStripMenuItem.Size = new System.Drawing.Size(214, 22);
this.openOBD2ScanToolToolStripMenuItem.Text = "Open OBD2 Scan Tool";
this.openOBD2ScanToolToolStripMenuItem.Click += new System.EventHandler(this.openOBD2ScanToolToolStripMenuItem_Click);
//
// convertrwdTobinToolStripMenuItem
//
this.convertrwdTobinToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.convertrwdTobinToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.convertrwdTobinToolStripMenuItem.Name = "convertrwdTobinToolStripMenuItem";
this.convertrwdTobinToolStripMenuItem.Size = new System.Drawing.Size(214, 22);
this.convertrwdTobinToolStripMenuItem.Text = "Convert .rwd to .bin";
this.convertrwdTobinToolStripMenuItem.Click += new System.EventHandler(this.convertrwdTobinToolStripMenuItem_Click);
//
// convertbinTorwdToolStripMenuItem
//
this.convertbinTorwdToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.convertbinTorwdToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.convertbinTorwdToolStripMenuItem.Name = "convertbinTorwdToolStripMenuItem";
this.convertbinTorwdToolStripMenuItem.Size = new System.Drawing.Size(214, 22);
this.convertbinTorwdToolStripMenuItem.Text = "Convert .bin to .rwd";
this.convertbinTorwdToolStripMenuItem.Click += new System.EventHandler(this.convertbinTorwdToolStripMenuItem_Click);
//
// removeBootloaderInbinToolStripMenuItem
//
this.removeBootloaderInbinToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65)))));
this.removeBootloaderInbinToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.removeBootloaderInbinToolStripMenuItem.Name = "removeBootloaderInbinToolStripMenuItem";
this.removeBootloaderInbinToolStripMenuItem.Size = new System.Drawing.Size(214, 22);
this.removeBootloaderInbinToolStripMenuItem.Text = "Remove Bootloader in .bin";
this.removeBootloaderInbinToolStripMenuItem.Click += new System.EventHandler(this.removeBootloaderInbinToolStripMenuItem_Click);
//
// splitContainer1
//
this.splitContainer1.BackColor = System.Drawing.SystemColors.ControlDark;
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 28);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.treeView1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(1100, 517);
this.splitContainer1.SplitterDistance = 297;
this.splitContainer1.TabIndex = 4;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.groupBox1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.darkTextBox_0);
this.splitContainer2.Size = new System.Drawing.Size(799, 517);
this.splitContainer2.SplitterDistance = 361;
this.splitContainer2.TabIndex = 0;
//
// darkTextBox_0
//
this.darkTextBox_0.ContextMenuStrip = this.contextMenuStrip1;
this.darkTextBox_0.Dock = System.Windows.Forms.DockStyle.Fill;
this.darkTextBox_0.Location = new System.Drawing.Point(0, 0);
this.darkTextBox_0.Multiline = true;
this.darkTextBox_0.Name = "darkTextBox_0";
this.darkTextBox_0.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.darkTextBox_0.Size = new System.Drawing.Size(799, 152);
this.darkTextBox_0.TabIndex = 56;
this.darkTextBox_0.Text = "Honda ROM Editor Tools";
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.clearLogsToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(130, 26);
//
// clearLogsToolStripMenuItem
//
this.clearLogsToolStripMenuItem.Name = "clearLogsToolStripMenuItem";
this.clearLogsToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
this.clearLogsToolStripMenuItem.Text = "Clear Logs";
this.clearLogsToolStripMenuItem.Click += new System.EventHandler(this.clearLogsToolStripMenuItem_Click);
//
// Editortable
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1100, 545);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.darkToolStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "Editortable";
this.Text = "Honda&Acura Rom Tables Editor";
this.Load += new System.EventHandler(this.Editortable_Load);
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView_0)).EndInit();
this.darkToolStrip1.ResumeLayout(false);
this.darkToolStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
this.splitContainer2.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
public void Editortable_Load(object sender, EventArgs e)
{
this.CreateRightClicMenu();
}
public void ClearLogs()
{
darkTextBox_0.Text = "";
}
public bool LoadDefinitionsFor(string string_9)
{
if (string_9 == ClassEditor_0.DefinitionsCurrentLoadedECU) return true;
int DefinitionsFilesCount = 0;
List<int> IndexLisst = new List<int>();
for (int i = 0; i < ClassEditor_0.Ecus_Definitions_Compatible.Count; i++)
{
if (ClassEditor_0.Ecus_Definitions_Compatible[i] == string_9)
{
DefinitionsFilesCount++;
IndexLisst.Add(i);
}
}
//More than one 'definition.txt' file have been found for the same ECU
if (DefinitionsFilesCount > 1)
{
GForm_SeveralDef GForm_SeveralDef_0 = new GForm_SeveralDef();
GForm_SeveralDef_0.LoadSetValues(ref GForm_Main_0, string_9, IndexLisst);
DialogResult result = GForm_SeveralDef_0.ShowDialog();
if (result == DialogResult.OK)
{
ClassEditor_0.LoadThisECUDefinitions(string_9, IndexLisst[GForm_SeveralDef_0.comboBox1.SelectedIndex]);
return true;
}
//HERE
//ClassEditor_0.LoadThisECUDefinitions(string_9, IndexLisst[0]);
//return true;
}
//Only one definition file matching
if (DefinitionsFilesCount == 1)
{
ClassEditor_0.LoadThisECUDefinitions(string_9, IndexLisst[0]);
return true;
}
//nothing found
return false;
}
public void method_1()
{
ClassEditor_0.CanReloadTablesValues = false;
if (!ClassEditor_0.LoadROMbytes(LoadedFilename))
{
DarkMessageBox.Show("Failed to open Binary file.");
}
else if (!this.LoadDefinitionsFor(ClassEditor_0.string_ECU_Name))
{
DarkMessageBox.Show("No definition found for " + ClassEditor_0.string_ECU_Name);
}
else
{
this.CreateNodes();
}
ClassEditor_0.CanReloadTablesValues = true;
}
private void CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if (ClassEditor_0.CanReloadTablesValues)
{
ClassEditor_0.ValuesChanged = true;
ClassEditor_0.SetBackColor(dataGridView_0.Columns.Count, float_1[0], float_1[1]);
}
}
public void CreateNodes()
{
this.treeView1.Nodes.Clear();
int num = 0;
List<string> AllUndefininedNodes = new List<string>();
List<string> AllUntestedNodes = new List<string>();
List<string> AllReadOnlyNodes = new List<string>();
//Makes Nodes
for (int i = 0; i < ClassEditor_0.DefinitionsName.Count; i++)
{
//#############################################
if (ClassEditor_0.DefinitionsIsReadOnly[i])
{
AllReadOnlyNodes.Add(ClassEditor_0.DefinitionsName[i]);
}
if (ClassEditor_0.DefinitionsIsUntested[i] && !ClassEditor_0.DefinitionsIsReadOnly[i])
{
AllUntestedNodes.Add(ClassEditor_0.DefinitionsName[i]);
}
if (ClassEditor_0.DefinitionsIsNotDefined[i] && !ClassEditor_0.DefinitionsIsUntested[i] && !ClassEditor_0.DefinitionsIsReadOnly[i])
{
AllUndefininedNodes.Add(ClassEditor_0.DefinitionsName[i]);
}
//#############################################
if (!ClassEditor_0.DefinitionsIsNotDefined[i] && !ClassEditor_0.DefinitionsIsUntested[i] && !ClassEditor_0.DefinitionsIsReadOnly[i])
{
string str = ClassEditor_0.DefinitionsName[i];
DarkTreeNode ThisNode = new DarkTreeNode();
if (str.ToString().Contains("----"))
{
ThisNode.Text = str.Replace("----", "");
this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes[this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Count - 1].Nodes.Add(ThisNode);
continue;
}
if (str.ToString().Contains("--"))
{
ThisNode.Text = str.Replace("--", "");
this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Add(ThisNode);
continue;
}
num++;
ThisNode.Text = str;
this.treeView1.Nodes.Add(ThisNode);
}
}
//Make Undefined Nodes
DarkTreeNode ThisNodeUnDefined = new DarkTreeNode();
ThisNodeUnDefined.Text = "Undefined parameters";
if (AllUndefininedNodes.Count > 0) this.treeView1.Nodes.Add(ThisNodeUnDefined);
for (int i = 0; i < AllUndefininedNodes.Count; i++)
{
string str = AllUndefininedNodes[i];
DarkTreeNode ThisNode = new DarkTreeNode();
if (str.ToString().Contains("--"))
{
ThisNode.Text = str.Replace("--", "");
this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Add(ThisNode);
//this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes[this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Count - 1].Nodes.Add(ThisNode);
continue;
}
num++;
ThisNode.Text = str;
this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Add(ThisNode);
}
//Make Untested Nodes
DarkTreeNode ThisNodeUnTested = new DarkTreeNode();
ThisNodeUnTested.Text = "Untested parameters";
if (AllUntestedNodes.Count > 0) this.treeView1.Nodes.Add(ThisNodeUnTested);
for (int i = 0; i < AllUntestedNodes.Count; i++)
{
string str = AllUntestedNodes[i];
DarkTreeNode ThisNode = new DarkTreeNode();
if (str.ToString().Contains("--"))
{
ThisNode.Text = str.Replace("--", "");
this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Add(ThisNode);
//this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes[this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Count - 1].Nodes.Add(ThisNode);
continue;
}
num++;
ThisNode.Text = str;
this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Add(ThisNode);
}
//Make ReadOnly Nodes
DarkTreeNode ThisNodeReadOnly = new DarkTreeNode();
ThisNodeReadOnly.Text = "ReadOnly parameters";
if (AllUntestedNodes.Count > 0) this.treeView1.Nodes.Add(ThisNodeReadOnly);
for (int i = 0; i < AllReadOnlyNodes.Count; i++)
{
string str = AllReadOnlyNodes[i];
DarkTreeNode ThisNode = new DarkTreeNode();
if (str.ToString().Contains("--"))
{
ThisNode.Text = str.Replace("--", "");
this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Add(ThisNode);
//this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes[this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Count - 1].Nodes.Add(ThisNode);
continue;
}
num++;
ThisNode.Text = str;
this.treeView1.Nodes[this.treeView1.Nodes.Count - 1].Nodes.Add(ThisNode);
}
//####################################################################################
/*foreach (DarkTreeNode node in this.treeView1.Nodes)
{
if (node.Nodes.Count > 0)
{
foreach (DarkTreeNode node2 in node.Nodes)
{
if (node.Text.Contains("limiter"))
{
node2.ImageKey = "Normal";
node2.SelectedImageKey = "Normal";
continue;
}
}
}
if ((node.Text.Contains("Revlimiter") || node.Text.Contains("Speedlimiter")) || node.Text.Contains("Limit"))
{
node.ImageKey = "Normal";
node.SelectedImageKey = "Normal";
}
else if (node.Text.Contains("00\x00b0"))
{
node.ImageKey = "Degree";
node.SelectedImageKey = "Degree";
}//...
}*/
//####################################################################################
}
private void method_4(object sender, KeyEventArgs e)
{
ClassEditor_0.ShortcutsCommand(e, 0);
}
public void CreateRightClicMenu()
{
ContextMenu menu = new ContextMenu {
MenuItems = {
{
"Increase selection",
new EventHandler(this.method_6)
},
{
"Decrease selection",
new EventHandler(this.method_7)
}
}
};
this.ContextMenu = menu;
}
private void method_6(object sender, EventArgs e)
{
ClassEditor_0.ShortcutsCommand(new KeyEventArgs(Keys.None), 2);
}
private void method_7(object sender, EventArgs e)
{
ClassEditor_0.ShortcutsCommand(new KeyEventArgs(Keys.None), 3);
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.icontainer_0 != null))
{
this.icontainer_0.Dispose();
}
base.Dispose(disposing);
}
/*public static ImageList ImageList_0
{
get
{
if (imageList_0 == null)
{
imageList_0 = new ImageList();
imageList_0.Images.Add("HighCam", global::Properties.Resources.Lightning2);
imageList_0.Images.Add("LowCam", global::Properties.Resources.Lightning);
imageList_0.Images.Add("HighFuel", global::Properties.Resources.injector2);
imageList_0.Images.Add("LowFuel", global::Properties.Resources.injector1);
imageList_0.Images.Add("Table", global::Properties.Resources.Script1);
imageList_0.Images.Add("Degree", global::Properties.Resources.Target);
imageList_0.Images.Add("Red", global::Properties.Resources.Report);
imageList_0.Images.Add("Normal", global::Properties.Resources.Wrench);
imageList_0.Images.Add("Vtec", global::Properties.Resources.Pinion);
imageList_0.Images.Add("Knock", global::Properties.Resources.Problem);
imageList_0.Images.Add("Bang", global::Properties.Resources.Disaster);
}
return imageList_0;
}
}*/
private int GetNodeParameterIndex(string text, string ParentNode)
{
//return within parent
if (ParentNode != "")
{
bool ParentFound = false;
for (int i = 0; i < ClassEditor_0.DefinitionsName.Count; i++)
{
if (ClassEditor_0.DefinitionsName[i] == ParentNode) ParentFound = true;
if (ParentFound)
{
if (ClassEditor_0.DefinitionsName[i] == text || ClassEditor_0.DefinitionsName[i] == "--" + text) return i;
}
}
}
//return exact
for (int i = 0; i < ClassEditor_0.DefinitionsName.Count; i++)
{
if (ClassEditor_0.DefinitionsName[i] == text)
{
return i;
}
}
//return approximative
for (int i = 0; i < ClassEditor_0.DefinitionsName.Count; i++)
{
if (ClassEditor_0.DefinitionsName[i].Contains(text))
{
return i;
}
}
//return error
return -1;
}
private void treeView1_AfterSelect(object sender, EventArgs e)
{
if (this.treeView1.SelectedNodes.Count == 0) return;
if ((this.treeView1.SelectedNode != null) && ClassEditor_0.CanReloadTablesValues)
{
ClassEditor_0.CanReloadTablesValues = false;
//##################################################################################
if (ClassEditor_0.ValuesChanged && ClassEditor_0.SelectedTableSize != 0 && ClassEditor_0.SelectedROMLocation != 0)
{
ClassEditor_0.GetChanges();
}
ClassEditor_0.ValuesChanged = false;
//##################################################################################
this.groupBox1.Text = "Table: " + this.treeView1.SelectedNode.Text;
string text = this.treeView1.SelectedNode.Text;
if (text != null)
{
string ParentNode = "";
if (this.treeView1.SelectedNode.ParentNode != null) ParentNode = this.treeView1.SelectedNode.ParentNode.Text;
int NodeIndex = GetNodeParameterIndex(text, ParentNode);
if (NodeIndex == -1)
{
Editortable_0.GForm_Main_0.method_1("ROM Indexing error with Nodes!");
ClassEditor_0.CanReloadTablesValues = true;
return;
}
//Empty 'Main' Node -> Select first child node
if (ClassEditor_0.DefinitionsTableSize[NodeIndex] == "")
{
try
{
ClassEditor_0.CanReloadTablesValues = true;
this.treeView1.SelectNode(this.treeView1.SelectedNode.Nodes[0]);
}
catch { }
return;
}
float_1[0] = ClassEditor_0.DefinitionsValueMin[NodeIndex];
float_1[1] = ClassEditor_0.DefinitionsValueMax[NodeIndex];
float_0 = (float) ClassEditor_0.DefinitionsChangeAmount[NodeIndex];
ClassEditor_0.IsSingleByteX = ClassEditor_0.DefinitionsIsSingleByteX[NodeIndex];
ClassEditor_0.IsSingleByteY = ClassEditor_0.DefinitionsIsSingleByteY[NodeIndex];
ClassEditor_0.IsSingleByteTable = ClassEditor_0.DefinitionsIsSingleByteTable[NodeIndex];
//Set TableSize
string TableSizeStr = ClassEditor_0.DefinitionsTableSize[NodeIndex].ToLower();
string[] TableSizeStrSplit = TableSizeStr.Split('x');
int[] TableSizze = new int[] { int.Parse(TableSizeStrSplit[0]), int.Parse(TableSizeStrSplit[1]) };
if (ClassEditor_0.DefinitionsLocationsX[NodeIndex].Length >= 10) ClassEditor_0.DefinitionsLocationsX[NodeIndex] = ClassEditor_0.DefinitionsLocationsX[NodeIndex].Replace("0x80", "0x");
if (ClassEditor_0.DefinitionsLocationsY[NodeIndex].Length >= 10) ClassEditor_0.DefinitionsLocationsY[NodeIndex] = ClassEditor_0.DefinitionsLocationsY[NodeIndex].Replace("0x80", "0x");
if (ClassEditor_0.DefinitionsLocationsTable[NodeIndex].Length >= 10) ClassEditor_0.DefinitionsLocationsTable[NodeIndex] = ClassEditor_0.DefinitionsLocationsTable[NodeIndex].Replace("0x80", "0x");
//Set X rom location
long ParamLocation = ClassEditor_0.HexStringToInt(ClassEditor_0.DefinitionsLocationsX[NodeIndex]);
//Set Y Headers (normal header mode)
int DoingThisSize = TableSizze[0];
if (ClassEditor_0.DefinitionsIsXYInverted[NodeIndex]) DoingThisSize = TableSizze[1];
string[] textArray1 = new string[DoingThisSize];
if (ClassEditor_0.DefinitionsHeaders[NodeIndex] != "" && ClassEditor_0.DefinitionsHeaders[NodeIndex].Contains(","))
{
string[] AllHeaders = ClassEditor_0.DefinitionsHeaders[NodeIndex].Split(',');
if (AllHeaders.Length != DoingThisSize) Editortable_0.GForm_Main_0.method_1("Headers length not matching Table Size");
if (AllHeaders.Length == DoingThisSize)
{
for (int i = 0; i < AllHeaders.Length; i++)
{
textArray1[i] = AllHeaders[i];
}
}
}
//Set Y Advanced Header (values from 'DefinitionsLocationsHeader' with mathematical function 'MathHeader')
string NewHeaderLocation = ClassEditor_0.DefinitionsLocationsY[NodeIndex];
if (NewHeaderLocation != "")
{
long ParamHeaderLocation = ClassEditor_0.HexStringToInt(NewHeaderLocation);
textArray1 = ClassEditor_0.GetAdvancedHeader(TableSizze[0], ParamHeaderLocation, ClassEditor_0.DefinitionsMathY[NodeIndex], ClassEditor_0.DefinitionsFormatY[NodeIndex]);
}
this.groupBox1.Text = "Table: " + this.treeView1.SelectedNode.Text + " (" + ClassEditor_0.DefinitionsLocationsTable[NodeIndex] + ")";
ClassEditor_0.SelectedTableIndexInDefinitions = NodeIndex;
//Show Value in Datagridview
ClassEditor_0.SetTableValues(TableSizze,
ParamLocation,
ClassEditor_0.DefinitionsUnit1[NodeIndex],
ClassEditor_0.DefinitionsUnit2[NodeIndex],
textArray1, ClassEditor_0.DefinitionsMathX[NodeIndex],
ClassEditor_0.DefinitionsFormatX[NodeIndex],
ClassEditor_0.DefinitionsIsXYInverted[NodeIndex],
ClassEditor_0.HexStringToInt(ClassEditor_0.DefinitionsLocationsTable[NodeIndex]),
ClassEditor_0.DefinitionsMathTable[NodeIndex], ClassEditor_0.DefinitionsFormatTable[NodeIndex],
ClassEditor_0.DefinitionsIsTableInverted[NodeIndex],
ClassEditor_0.DefinitionsIsReadOnly[NodeIndex]);
}
}
ClassEditor_0.CanReloadTablesValues = true;
}
public int CheckForBootLoaderSum(string ThisECUName)
{
string BLSumPath = Application.StartupPath + @"\BootLoaderSumBytesList.txt";
if (File.Exists(BLSumPath))
{
string[] AllLines = File.ReadAllLines(BLSumPath);
for (int i = 0; i < AllLines.Length; i++)
{
if (AllLines[i].Contains("|"))
{
string[] SplittedCommands = AllLines[i].Split('|');
if (SplittedCommands[0] == ThisECUName)
{
return int.Parse(SplittedCommands[1]);
}
}
}
}
return -1;
}
public string ExtractECUNameFromThisFile(byte[] ThisFileBytes)
{