";
522 | this.lblCurrentFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
523 | //
524 | // panel9
525 | //
526 | this.panel9.Controls.Add(this.label2);
527 | this.panel9.Dock = System.Windows.Forms.DockStyle.Left;
528 | this.panel9.Location = new System.Drawing.Point(0, 0);
529 | this.panel9.Name = "panel9";
530 | this.panel9.Size = new System.Drawing.Size(77, 31);
531 | this.panel9.TabIndex = 7;
532 | //
533 | // label2
534 | //
535 | this.label2.AutoSize = true;
536 | this.label2.Location = new System.Drawing.Point(9, 8);
537 | this.label2.Name = "label2";
538 | this.label2.Size = new System.Drawing.Size(63, 13);
539 | this.label2.TabIndex = 5;
540 | this.label2.Text = "Current File:";
541 | //
542 | // openFileDialog1
543 | //
544 | this.openFileDialog1.DefaultExt = "py";
545 | this.openFileDialog1.Filter = "All Files (*.*)|*.*|Python Files (*.py)|*.*";
546 | //
547 | // saveFileDialog1
548 | //
549 | this.saveFileDialog1.Title = "Export File";
550 | //
551 | // tmrMessage
552 | //
553 | this.tmrMessage.Interval = 800;
554 | this.tmrMessage.Tick += new System.EventHandler(this.tmrMessage_Tick);
555 | //
556 | // frmMain
557 | //
558 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
559 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
560 | this.ClientSize = new System.Drawing.Size(1046, 637);
561 | this.Controls.Add(this.mainSplitter);
562 | this.Controls.Add(this.pnlToolbar);
563 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
564 | this.Name = "frmMain";
565 | this.Text = "Ampy File Manager";
566 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing);
567 | this.Load += new System.EventHandler(this.frmMain_Load);
568 | this.pnlToolbar.ResumeLayout(false);
569 | this.panel1.ResumeLayout(false);
570 | this.panel1.PerformLayout();
571 | this.mainSplitter.Panel1.ResumeLayout(false);
572 | this.mainSplitter.Panel2.ResumeLayout(false);
573 | ((System.ComponentModel.ISupportInitialize)(this.mainSplitter)).EndInit();
574 | this.mainSplitter.ResumeLayout(false);
575 | this.pnlPathStatus.ResumeLayout(false);
576 | this.pnlPathStatus.PerformLayout();
577 | this.pnlPathTop.ResumeLayout(false);
578 | this.panel3.ResumeLayout(false);
579 | this.panel3.PerformLayout();
580 | this.pnlSaveMessage.ResumeLayout(false);
581 | this.pnlSaveMessage.PerformLayout();
582 | this.pnlFileStatus.ResumeLayout(false);
583 | this.panel10.ResumeLayout(false);
584 | this.pnlFileToolbar.ResumeLayout(false);
585 | this.panel9.ResumeLayout(false);
586 | this.panel9.PerformLayout();
587 | this.ResumeLayout(false);
588 |
589 | }
590 |
591 | #endregion
592 |
593 | private System.Windows.Forms.Panel pnlToolbar;
594 | private System.Windows.Forms.SplitContainer mainSplitter;
595 | private System.Windows.Forms.Panel panel1;
596 | private System.Windows.Forms.Button btnExport;
597 | private System.Windows.Forms.Button btnMove;
598 | private System.Windows.Forms.Button btnRun;
599 | private System.Windows.Forms.Button btnRefresh;
600 | private System.Windows.Forms.Button btnMkdir;
601 | private System.Windows.Forms.Button btnLoad;
602 | private System.Windows.Forms.Button btnNew;
603 | private System.Windows.Forms.Button btnDelete;
604 | private System.Windows.Forms.Button btnOpen;
605 | private System.Windows.Forms.Button btnREPL;
606 | private System.Windows.Forms.Label label3;
607 | private System.Windows.Forms.ComboBox cboHelp;
608 | private System.Windows.Forms.Panel pnlFileToolbar;
609 | private System.Windows.Forms.Panel pnlPathTop;
610 | private System.Windows.Forms.Label lblCurrentDirectory;
611 | private System.Windows.Forms.Panel panel3;
612 | private System.Windows.Forms.Label label1;
613 | private System.Windows.Forms.Panel panel9;
614 | private System.Windows.Forms.Label label2;
615 | private System.Windows.Forms.Label lblCurrentFile;
616 | private System.Windows.Forms.ToolTip toolTip1;
617 | private System.Windows.Forms.OpenFileDialog openFileDialog1;
618 | private System.Windows.Forms.SaveFileDialog saveFileDialog1;
619 | private System.Windows.Forms.ListBox lstDirectory;
620 | private System.Windows.Forms.Panel pnlPathStatus;
621 | private ScintillaNET.Scintilla scintilla1;
622 | private System.Windows.Forms.Panel pnlFileStatus;
623 | private System.Windows.Forms.Label lblFileCount;
624 | private System.Windows.Forms.Label label6;
625 | private System.Windows.Forms.Label lblFolderCount;
626 | private System.Windows.Forms.Label label4;
627 | private System.Windows.Forms.Panel pnlSaveMessage;
628 | private System.Windows.Forms.Label label5;
629 | private System.Windows.Forms.Timer tmrMessage;
630 | private System.Windows.Forms.Panel panel10;
631 | private System.Windows.Forms.Button btnReplaceAll;
632 | private System.Windows.Forms.Button btnSaveAs;
633 | private System.Windows.Forms.Button btnSave;
634 | private System.Windows.Forms.Button btnBackupScript;
635 | private System.Windows.Forms.Button btnRestoreScript;
636 | }
637 | }
--------------------------------------------------------------------------------
/AmpyFileManager/Manager.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace AmpyFileManager
2 | {
3 | partial class Manager
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Manager));
33 | this.panel1 = new System.Windows.Forms.Panel();
34 | this.btnExport = new System.Windows.Forms.Button();
35 | this.btnMove = new System.Windows.Forms.Button();
36 | this.btnRun = new System.Windows.Forms.Button();
37 | this.btnBackup = new System.Windows.Forms.Button();
38 | this.btnRefresh = new System.Windows.Forms.Button();
39 | this.panel5 = new System.Windows.Forms.Panel();
40 | this.label3 = new System.Windows.Forms.Label();
41 | this.cboHelp = new System.Windows.Forms.ComboBox();
42 | this.btnLoadHelp = new System.Windows.Forms.Button();
43 | this.btnChangeMode = new System.Windows.Forms.Button();
44 | this.btnMkdir = new System.Windows.Forms.Button();
45 | this.btnLoad = new System.Windows.Forms.Button();
46 | this.btnNew = new System.Windows.Forms.Button();
47 | this.btnDelete = new System.Windows.Forms.Button();
48 | this.btnOpen = new System.Windows.Forms.Button();
49 | this.label1 = new System.Windows.Forms.Label();
50 | this.splitContainer1 = new System.Windows.Forms.SplitContainer();
51 | this.lstDirectory = new System.Windows.Forms.ListBox();
52 | this.panel3 = new System.Windows.Forms.Panel();
53 | this.lblCurrentDirectory = new System.Windows.Forms.Label();
54 | this.panel6 = new System.Windows.Forms.Panel();
55 | this.scintilla1 = new ScintillaNET.Scintilla();
56 | this.panel2 = new System.Windows.Forms.Panel();
57 | this.lblCurrentFile = new System.Windows.Forms.Label();
58 | this.panel10 = new System.Windows.Forms.Panel();
59 | this.btnReplaceAll = new System.Windows.Forms.Button();
60 | this.btnSaveAs = new System.Windows.Forms.Button();
61 | this.btnSave = new System.Windows.Forms.Button();
62 | this.panel9 = new System.Windows.Forms.Panel();
63 | this.label2 = new System.Windows.Forms.Label();
64 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
65 | this.serialPort1 = new System.IO.Ports.SerialPort(this.components);
66 | this.splitContainer2 = new System.Windows.Forms.SplitContainer();
67 | this.txtTerminal = new System.Windows.Forms.TextBox();
68 | this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
69 | this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
70 | this.panel4 = new System.Windows.Forms.Panel();
71 | this.btnCustom = new System.Windows.Forms.Button();
72 | this.panel7 = new System.Windows.Forms.Panel();
73 | this.picCommStatus = new System.Windows.Forms.PictureBox();
74 | this.btnControlD = new System.Windows.Forms.Button();
75 | this.btnControlC = new System.Windows.Forms.Button();
76 | this.tmrCommStatus = new System.Windows.Forms.Timer(this.components);
77 | this.tmrRunCommand = new System.Windows.Forms.Timer(this.components);
78 | this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
79 | this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
80 | this.panel1.SuspendLayout();
81 | this.panel5.SuspendLayout();
82 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
83 | this.splitContainer1.Panel1.SuspendLayout();
84 | this.splitContainer1.Panel2.SuspendLayout();
85 | this.splitContainer1.SuspendLayout();
86 | this.panel3.SuspendLayout();
87 | this.panel6.SuspendLayout();
88 | this.panel2.SuspendLayout();
89 | this.panel10.SuspendLayout();
90 | this.panel9.SuspendLayout();
91 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
92 | this.splitContainer2.Panel1.SuspendLayout();
93 | this.splitContainer2.Panel2.SuspendLayout();
94 | this.splitContainer2.SuspendLayout();
95 | this.contextMenuStrip1.SuspendLayout();
96 | this.panel4.SuspendLayout();
97 | this.panel7.SuspendLayout();
98 | ((System.ComponentModel.ISupportInitialize)(this.picCommStatus)).BeginInit();
99 | this.SuspendLayout();
100 | //
101 | // panel1
102 | //
103 | this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
104 | this.panel1.Controls.Add(this.btnExport);
105 | this.panel1.Controls.Add(this.btnMove);
106 | this.panel1.Controls.Add(this.btnRun);
107 | this.panel1.Controls.Add(this.btnBackup);
108 | this.panel1.Controls.Add(this.btnRefresh);
109 | this.panel1.Controls.Add(this.panel5);
110 | this.panel1.Controls.Add(this.btnMkdir);
111 | this.panel1.Controls.Add(this.btnLoad);
112 | this.panel1.Controls.Add(this.btnNew);
113 | this.panel1.Controls.Add(this.btnDelete);
114 | this.panel1.Controls.Add(this.btnOpen);
115 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
116 | this.panel1.Location = new System.Drawing.Point(0, 0);
117 | this.panel1.Name = "panel1";
118 | this.panel1.Size = new System.Drawing.Size(1173, 45);
119 | this.panel1.TabIndex = 0;
120 | //
121 | // btnExport
122 | //
123 | this.btnExport.Image = ((System.Drawing.Image)(resources.GetObject("btnExport.Image")));
124 | this.btnExport.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
125 | this.btnExport.Location = new System.Drawing.Point(191, 7);
126 | this.btnExport.Name = "btnExport";
127 | this.btnExport.Size = new System.Drawing.Size(67, 30);
128 | this.btnExport.TabIndex = 3;
129 | this.btnExport.Text = "Export";
130 | this.btnExport.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
131 | this.btnExport.UseVisualStyleBackColor = true;
132 | this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
133 | //
134 | // btnMove
135 | //
136 | this.btnMove.Image = ((System.Drawing.Image)(resources.GetObject("btnMove.Image")));
137 | this.btnMove.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
138 | this.btnMove.Location = new System.Drawing.Point(326, 7);
139 | this.btnMove.Name = "btnMove";
140 | this.btnMove.Size = new System.Drawing.Size(69, 30);
141 | this.btnMove.TabIndex = 5;
142 | this.btnMove.Text = "Move";
143 | this.btnMove.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
144 | this.btnMove.UseVisualStyleBackColor = true;
145 | this.btnMove.Click += new System.EventHandler(this.btnMove_Click);
146 | //
147 | // btnRun
148 | //
149 | this.btnRun.Image = ((System.Drawing.Image)(resources.GetObject("btnRun.Image")));
150 | this.btnRun.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
151 | this.btnRun.Location = new System.Drawing.Point(540, 7);
152 | this.btnRun.Name = "btnRun";
153 | this.btnRun.Size = new System.Drawing.Size(51, 30);
154 | this.btnRun.TabIndex = 8;
155 | this.btnRun.Text = "Run";
156 | this.btnRun.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
157 | this.btnRun.UseVisualStyleBackColor = true;
158 | this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
159 | //
160 | // btnBackup
161 | //
162 | this.btnBackup.Image = ((System.Drawing.Image)(resources.GetObject("btnBackup.Image")));
163 | this.btnBackup.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
164 | this.btnBackup.Location = new System.Drawing.Point(594, 7);
165 | this.btnBackup.Name = "btnBackup";
166 | this.btnBackup.Size = new System.Drawing.Size(72, 30);
167 | this.btnBackup.TabIndex = 9;
168 | this.btnBackup.Text = "Backup";
169 | this.btnBackup.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
170 | this.btnBackup.UseVisualStyleBackColor = true;
171 | this.btnBackup.Click += new System.EventHandler(this.btnBackup_Click);
172 | //
173 | // btnRefresh
174 | //
175 | this.btnRefresh.Image = ((System.Drawing.Image)(resources.GetObject("btnRefresh.Image")));
176 | this.btnRefresh.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
177 | this.btnRefresh.Location = new System.Drawing.Point(469, 7);
178 | this.btnRefresh.Name = "btnRefresh";
179 | this.btnRefresh.Size = new System.Drawing.Size(67, 30);
180 | this.btnRefresh.TabIndex = 7;
181 | this.btnRefresh.Text = "Refresh";
182 | this.btnRefresh.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
183 | this.btnRefresh.UseVisualStyleBackColor = true;
184 | this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
185 | //
186 | // panel5
187 | //
188 | this.panel5.Controls.Add(this.label3);
189 | this.panel5.Controls.Add(this.cboHelp);
190 | this.panel5.Controls.Add(this.btnLoadHelp);
191 | this.panel5.Controls.Add(this.btnChangeMode);
192 | this.panel5.Dock = System.Windows.Forms.DockStyle.Right;
193 | this.panel5.Location = new System.Drawing.Point(720, 0);
194 | this.panel5.Name = "panel5";
195 | this.panel5.Size = new System.Drawing.Size(449, 41);
196 | this.panel5.TabIndex = 7;
197 | //
198 | // label3
199 | //
200 | this.label3.AutoSize = true;
201 | this.label3.Location = new System.Drawing.Point(109, 16);
202 | this.label3.Name = "label3";
203 | this.label3.Size = new System.Drawing.Size(32, 13);
204 | this.label3.TabIndex = 13;
205 | this.label3.Text = "Help:";
206 | //
207 | // cboHelp
208 | //
209 | this.cboHelp.FormattingEnabled = true;
210 | this.cboHelp.Location = new System.Drawing.Point(142, 11);
211 | this.cboHelp.Name = "cboHelp";
212 | this.cboHelp.Size = new System.Drawing.Size(169, 21);
213 | this.cboHelp.TabIndex = 10;
214 | this.cboHelp.SelectedIndexChanged += new System.EventHandler(this.cboHelp_SelectedIndexChanged);
215 | //
216 | // btnLoadHelp
217 | //
218 | this.btnLoadHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnLoadHelp.Image")));
219 | this.btnLoadHelp.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
220 | this.btnLoadHelp.Location = new System.Drawing.Point(3, 5);
221 | this.btnLoadHelp.Name = "btnLoadHelp";
222 | this.btnLoadHelp.Size = new System.Drawing.Size(72, 31);
223 | this.btnLoadHelp.TabIndex = 11;
224 | this.btnLoadHelp.Text = "View...";
225 | this.btnLoadHelp.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
226 | this.btnLoadHelp.UseVisualStyleBackColor = true;
227 | this.btnLoadHelp.Visible = false;
228 | this.btnLoadHelp.Click += new System.EventHandler(this.btnLoadHelp_Click);
229 | //
230 | // btnChangeMode
231 | //
232 | this.btnChangeMode.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
233 | this.btnChangeMode.ForeColor = System.Drawing.Color.Red;
234 | this.btnChangeMode.Image = ((System.Drawing.Image)(resources.GetObject("btnChangeMode.Image")));
235 | this.btnChangeMode.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
236 | this.btnChangeMode.Location = new System.Drawing.Point(327, 5);
237 | this.btnChangeMode.Name = "btnChangeMode";
238 | this.btnChangeMode.Size = new System.Drawing.Size(116, 31);
239 | this.btnChangeMode.TabIndex = 12;
240 | this.btnChangeMode.Text = "REPL";
241 | this.btnChangeMode.UseVisualStyleBackColor = true;
242 | this.btnChangeMode.Click += new System.EventHandler(this.btnChangeMode_Click);
243 | //
244 | // btnMkdir
245 | //
246 | this.btnMkdir.Image = ((System.Drawing.Image)(resources.GetObject("btnMkdir.Image")));
247 | this.btnMkdir.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
248 | this.btnMkdir.Location = new System.Drawing.Point(398, 7);
249 | this.btnMkdir.Name = "btnMkdir";
250 | this.btnMkdir.Size = new System.Drawing.Size(68, 30);
251 | this.btnMkdir.TabIndex = 6;
252 | this.btnMkdir.Text = "MKDIR";
253 | this.btnMkdir.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
254 | this.btnMkdir.UseVisualStyleBackColor = true;
255 | this.btnMkdir.Click += new System.EventHandler(this.btnMkdir_Click);
256 | //
257 | // btnLoad
258 | //
259 | this.btnLoad.Image = ((System.Drawing.Image)(resources.GetObject("btnLoad.Image")));
260 | this.btnLoad.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
261 | this.btnLoad.Location = new System.Drawing.Point(129, 7);
262 | this.btnLoad.Name = "btnLoad";
263 | this.btnLoad.Size = new System.Drawing.Size(59, 30);
264 | this.btnLoad.TabIndex = 2;
265 | this.btnLoad.Text = "Load";
266 | this.btnLoad.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
267 | this.btnLoad.UseVisualStyleBackColor = true;
268 | this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
269 | //
270 | // btnNew
271 | //
272 | this.btnNew.Image = ((System.Drawing.Image)(resources.GetObject("btnNew.Image")));
273 | this.btnNew.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
274 | this.btnNew.Location = new System.Drawing.Point(10, 7);
275 | this.btnNew.Name = "btnNew";
276 | this.btnNew.Size = new System.Drawing.Size(54, 30);
277 | this.btnNew.TabIndex = 0;
278 | this.btnNew.Text = "New";
279 | this.btnNew.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
280 | this.btnNew.UseVisualStyleBackColor = true;
281 | this.btnNew.Click += new System.EventHandler(this.btnNew_Click);
282 | //
283 | // btnDelete
284 | //
285 | this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
286 | this.btnDelete.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
287 | this.btnDelete.Location = new System.Drawing.Point(261, 7);
288 | this.btnDelete.Name = "btnDelete";
289 | this.btnDelete.Size = new System.Drawing.Size(62, 30);
290 | this.btnDelete.TabIndex = 4;
291 | this.btnDelete.Text = "Delete";
292 | this.btnDelete.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
293 | this.btnDelete.UseVisualStyleBackColor = true;
294 | this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
295 | //
296 | // btnOpen
297 | //
298 | this.btnOpen.Image = ((System.Drawing.Image)(resources.GetObject("btnOpen.Image")));
299 | this.btnOpen.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
300 | this.btnOpen.Location = new System.Drawing.Point(68, 7);
301 | this.btnOpen.Name = "btnOpen";
302 | this.btnOpen.Size = new System.Drawing.Size(59, 30);
303 | this.btnOpen.TabIndex = 1;
304 | this.btnOpen.Text = "Open";
305 | this.btnOpen.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
306 | this.btnOpen.UseVisualStyleBackColor = true;
307 | this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
308 | //
309 | // label1
310 | //
311 | this.label1.AutoSize = true;
312 | this.label1.Location = new System.Drawing.Point(3, 8);
313 | this.label1.Name = "label1";
314 | this.label1.Size = new System.Drawing.Size(69, 13);
315 | this.label1.TabIndex = 0;
316 | this.label1.Text = "Current Path:";
317 | //
318 | // splitContainer1
319 | //
320 | this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
321 | this.splitContainer1.Location = new System.Drawing.Point(0, 0);
322 | this.splitContainer1.Name = "splitContainer1";
323 | //
324 | // splitContainer1.Panel1
325 | //
326 | this.splitContainer1.Panel1.Controls.Add(this.lstDirectory);
327 | this.splitContainer1.Panel1.Controls.Add(this.panel3);
328 | //
329 | // splitContainer1.Panel2
330 | //
331 | this.splitContainer1.Panel2.Controls.Add(this.scintilla1);
332 | this.splitContainer1.Panel2.Controls.Add(this.panel2);
333 | this.splitContainer1.Size = new System.Drawing.Size(1173, 467);
334 | this.splitContainer1.SplitterDistance = 257;
335 | this.splitContainer1.TabIndex = 1;
336 | //
337 | // lstDirectory
338 | //
339 | this.lstDirectory.BackColor = System.Drawing.Color.Moccasin;
340 | this.lstDirectory.Dock = System.Windows.Forms.DockStyle.Fill;
341 | this.lstDirectory.Font = new System.Drawing.Font("Consolas", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
342 | this.lstDirectory.FormattingEnabled = true;
343 | this.lstDirectory.IntegralHeight = false;
344 | this.lstDirectory.ItemHeight = 22;
345 | this.lstDirectory.Location = new System.Drawing.Point(0, 33);
346 | this.lstDirectory.Name = "lstDirectory";
347 | this.lstDirectory.Size = new System.Drawing.Size(257, 434);
348 | this.lstDirectory.TabIndex = 13;
349 | this.lstDirectory.DoubleClick += new System.EventHandler(this.lstDirectory_DoubleClick);
350 | //
351 | // panel3
352 | //
353 | this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
354 | this.panel3.Controls.Add(this.lblCurrentDirectory);
355 | this.panel3.Controls.Add(this.panel6);
356 | this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
357 | this.panel3.Location = new System.Drawing.Point(0, 0);
358 | this.panel3.Name = "panel3";
359 | this.panel3.Size = new System.Drawing.Size(257, 33);
360 | this.panel3.TabIndex = 0;
361 | //
362 | // lblCurrentDirectory
363 | //
364 | this.lblCurrentDirectory.Dock = System.Windows.Forms.DockStyle.Fill;
365 | this.lblCurrentDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
366 | this.lblCurrentDirectory.Location = new System.Drawing.Point(74, 0);
367 | this.lblCurrentDirectory.Name = "lblCurrentDirectory";
368 | this.lblCurrentDirectory.Size = new System.Drawing.Size(179, 29);
369 | this.lblCurrentDirectory.TabIndex = 3;
370 | this.lblCurrentDirectory.Text = "label2";
371 | this.lblCurrentDirectory.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
372 | //
373 | // panel6
374 | //
375 | this.panel6.Controls.Add(this.label1);
376 | this.panel6.Dock = System.Windows.Forms.DockStyle.Left;
377 | this.panel6.Location = new System.Drawing.Point(0, 0);
378 | this.panel6.Name = "panel6";
379 | this.panel6.Size = new System.Drawing.Size(74, 29);
380 | this.panel6.TabIndex = 2;
381 | //
382 | // scintilla1
383 | //
384 | this.scintilla1.Dock = System.Windows.Forms.DockStyle.Fill;
385 | this.scintilla1.EolMode = ScintillaNET.Eol.Lf;
386 | this.scintilla1.IndentationGuides = ScintillaNET.IndentView.Real;
387 | this.scintilla1.Lexer = ScintillaNET.Lexer.Python;
388 | this.scintilla1.Location = new System.Drawing.Point(0, 33);
389 | this.scintilla1.Name = "scintilla1";
390 | this.scintilla1.Size = new System.Drawing.Size(912, 434);
391 | this.scintilla1.TabIndex = 14;
392 | this.scintilla1.TextChanged += new System.EventHandler(this.scintilla1_TextChanged);
393 | //
394 | // panel2
395 | //
396 | this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
397 | this.panel2.Controls.Add(this.lblCurrentFile);
398 | this.panel2.Controls.Add(this.panel10);
399 | this.panel2.Controls.Add(this.panel9);
400 | this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
401 | this.panel2.Location = new System.Drawing.Point(0, 0);
402 | this.panel2.Name = "panel2";
403 | this.panel2.Size = new System.Drawing.Size(912, 33);
404 | this.panel2.TabIndex = 0;
405 | //
406 | // lblCurrentFile
407 | //
408 | this.lblCurrentFile.Dock = System.Windows.Forms.DockStyle.Fill;
409 | this.lblCurrentFile.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
410 | this.lblCurrentFile.Location = new System.Drawing.Point(77, 0);
411 | this.lblCurrentFile.Name = "lblCurrentFile";
412 | this.lblCurrentFile.Size = new System.Drawing.Size(610, 29);
413 | this.lblCurrentFile.TabIndex = 8;
414 | this.lblCurrentFile.Text = "label2";
415 | this.lblCurrentFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
416 | //
417 | // panel10
418 | //
419 | this.panel10.Controls.Add(this.btnReplaceAll);
420 | this.panel10.Controls.Add(this.btnSaveAs);
421 | this.panel10.Controls.Add(this.btnSave);
422 | this.panel10.Dock = System.Windows.Forms.DockStyle.Right;
423 | this.panel10.Location = new System.Drawing.Point(687, 0);
424 | this.panel10.Name = "panel10";
425 | this.panel10.Size = new System.Drawing.Size(221, 29);
426 | this.panel10.TabIndex = 7;
427 | //
428 | // btnReplaceAll
429 | //
430 | this.btnReplaceAll.Location = new System.Drawing.Point(9, 4);
431 | this.btnReplaceAll.Name = "btnReplaceAll";
432 | this.btnReplaceAll.Size = new System.Drawing.Size(72, 22);
433 | this.btnReplaceAll.TabIndex = 17;
434 | this.btnReplaceAll.Text = "Replace All";
435 | this.btnReplaceAll.UseVisualStyleBackColor = true;
436 | this.btnReplaceAll.Click += new System.EventHandler(this.btnReplaceAll_Click);
437 | //
438 | // btnSaveAs
439 | //
440 | this.btnSaveAs.Location = new System.Drawing.Point(84, 4);
441 | this.btnSaveAs.Name = "btnSaveAs";
442 | this.btnSaveAs.Size = new System.Drawing.Size(75, 22);
443 | this.btnSaveAs.TabIndex = 15;
444 | this.btnSaveAs.Text = "Save As...";
445 | this.btnSaveAs.UseVisualStyleBackColor = true;
446 | this.btnSaveAs.Click += new System.EventHandler(this.btnSaveAs_Click);
447 | //
448 | // btnSave
449 | //
450 | this.btnSave.Location = new System.Drawing.Point(162, 4);
451 | this.btnSave.Name = "btnSave";
452 | this.btnSave.Size = new System.Drawing.Size(53, 22);
453 | this.btnSave.TabIndex = 16;
454 | this.btnSave.Text = "Save";
455 | this.btnSave.UseVisualStyleBackColor = true;
456 | this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
457 | //
458 | // panel9
459 | //
460 | this.panel9.Controls.Add(this.label2);
461 | this.panel9.Dock = System.Windows.Forms.DockStyle.Left;
462 | this.panel9.Location = new System.Drawing.Point(0, 0);
463 | this.panel9.Name = "panel9";
464 | this.panel9.Size = new System.Drawing.Size(77, 29);
465 | this.panel9.TabIndex = 6;
466 | //
467 | // label2
468 | //
469 | this.label2.AutoSize = true;
470 | this.label2.Location = new System.Drawing.Point(9, 8);
471 | this.label2.Name = "label2";
472 | this.label2.Size = new System.Drawing.Size(63, 13);
473 | this.label2.TabIndex = 5;
474 | this.label2.Text = "Current File:";
475 | //
476 | // openFileDialog1
477 | //
478 | this.openFileDialog1.DefaultExt = "py";
479 | this.openFileDialog1.Filter = "All Files (*.*)|*.*|Python Files (*.py)|*.*";
480 | //
481 | // serialPort1
482 | //
483 | this.serialPort1.BaudRate = 115200;
484 | this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived);
485 | //
486 | // splitContainer2
487 | //
488 | this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
489 | this.splitContainer2.Location = new System.Drawing.Point(0, 45);
490 | this.splitContainer2.Name = "splitContainer2";
491 | this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
492 | //
493 | // splitContainer2.Panel1
494 | //
495 | this.splitContainer2.Panel1.Controls.Add(this.splitContainer1);
496 | //
497 | // splitContainer2.Panel2
498 | //
499 | this.splitContainer2.Panel2.Controls.Add(this.txtTerminal);
500 | this.splitContainer2.Panel2.Controls.Add(this.panel4);
501 | this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(5);
502 | this.splitContainer2.Size = new System.Drawing.Size(1173, 620);
503 | this.splitContainer2.SplitterDistance = 467;
504 | this.splitContainer2.TabIndex = 2;
505 | //
506 | // txtTerminal
507 | //
508 | this.txtTerminal.AcceptsTab = true;
509 | this.txtTerminal.BackColor = System.Drawing.Color.Black;
510 | this.txtTerminal.ContextMenuStrip = this.contextMenuStrip1;
511 | this.txtTerminal.Dock = System.Windows.Forms.DockStyle.Fill;
512 | this.txtTerminal.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
513 | this.txtTerminal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
514 | this.txtTerminal.Location = new System.Drawing.Point(5, 5);
515 | this.txtTerminal.Multiline = true;
516 | this.txtTerminal.Name = "txtTerminal";
517 | this.txtTerminal.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
518 | this.txtTerminal.Size = new System.Drawing.Size(1064, 139);
519 | this.txtTerminal.TabIndex = 0;
520 | this.txtTerminal.Enter += new System.EventHandler(this.txtTerminal_Enter);
521 | this.txtTerminal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtTerminal_KeyDown);
522 | this.txtTerminal.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtTerminal_KeyPress);
523 | this.txtTerminal.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.txtTerminal_PreviewKeyDown);
524 | //
525 | // contextMenuStrip1
526 | //
527 | this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
528 | this.pasteToolStripMenuItem});
529 | this.contextMenuStrip1.Name = "contextMenuStrip1";
530 | this.contextMenuStrip1.Size = new System.Drawing.Size(103, 26);
531 | this.contextMenuStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip1_ItemClicked);
532 | //
533 | // pasteToolStripMenuItem
534 | //
535 | this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
536 | this.pasteToolStripMenuItem.Size = new System.Drawing.Size(102, 22);
537 | this.pasteToolStripMenuItem.Text = "Paste";
538 | //
539 | // panel4
540 | //
541 | this.panel4.Controls.Add(this.btnCustom);
542 | this.panel4.Controls.Add(this.panel7);
543 | this.panel4.Controls.Add(this.btnControlD);
544 | this.panel4.Controls.Add(this.btnControlC);
545 | this.panel4.Dock = System.Windows.Forms.DockStyle.Right;
546 | this.panel4.Location = new System.Drawing.Point(1069, 5);
547 | this.panel4.Name = "panel4";
548 | this.panel4.Size = new System.Drawing.Size(99, 139);
549 | this.panel4.TabIndex = 1;
550 | //
551 | // btnCustom
552 | //
553 | this.btnCustom.Location = new System.Drawing.Point(13, 62);
554 | this.btnCustom.Name = "btnCustom";
555 | this.btnCustom.Size = new System.Drawing.Size(75, 22);
556 | this.btnCustom.TabIndex = 17;
557 | this.btnCustom.Text = "Custom...";
558 | this.btnCustom.UseVisualStyleBackColor = true;
559 | this.btnCustom.Visible = false;
560 | this.btnCustom.Click += new System.EventHandler(this.btnCustom_Click);
561 | //
562 | // panel7
563 | //
564 | this.panel7.Controls.Add(this.picCommStatus);
565 | this.panel7.Dock = System.Windows.Forms.DockStyle.Bottom;
566 | this.panel7.Location = new System.Drawing.Point(0, 105);
567 | this.panel7.Name = "panel7";
568 | this.panel7.Size = new System.Drawing.Size(99, 34);
569 | this.panel7.TabIndex = 16;
570 | //
571 | // picCommStatus
572 | //
573 | this.picCommStatus.BackColor = System.Drawing.Color.Red;
574 | this.picCommStatus.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
575 | this.picCommStatus.Location = new System.Drawing.Point(13, 9);
576 | this.picCommStatus.Name = "picCommStatus";
577 | this.picCommStatus.Size = new System.Drawing.Size(17, 17);
578 | this.picCommStatus.TabIndex = 6;
579 | this.picCommStatus.TabStop = false;
580 | this.picCommStatus.Visible = false;
581 | //
582 | // btnControlD
583 | //
584 | this.btnControlD.Location = new System.Drawing.Point(13, 34);
585 | this.btnControlD.Name = "btnControlD";
586 | this.btnControlD.Size = new System.Drawing.Size(75, 22);
587 | this.btnControlD.TabIndex = 16;
588 | this.btnControlD.Text = "Send Ctrl-D";
589 | this.btnControlD.UseVisualStyleBackColor = true;
590 | this.btnControlD.Click += new System.EventHandler(this.btnControlD_Click);
591 | //
592 | // btnControlC
593 | //
594 | this.btnControlC.Location = new System.Drawing.Point(13, 6);
595 | this.btnControlC.Name = "btnControlC";
596 | this.btnControlC.Size = new System.Drawing.Size(75, 22);
597 | this.btnControlC.TabIndex = 15;
598 | this.btnControlC.Text = "Send Ctrl-C";
599 | this.btnControlC.UseVisualStyleBackColor = true;
600 | this.btnControlC.Click += new System.EventHandler(this.btnControlC_Click);
601 | //
602 | // tmrCommStatus
603 | //
604 | this.tmrCommStatus.Enabled = true;
605 | this.tmrCommStatus.Interval = 1000;
606 | this.tmrCommStatus.Tick += new System.EventHandler(this.tmrCommStatus_Tick);
607 | //
608 | // tmrRunCommand
609 | //
610 | this.tmrRunCommand.Interval = 3000;
611 | this.tmrRunCommand.Tick += new System.EventHandler(this.tmrRunCommand_Tick);
612 | //
613 | // saveFileDialog1
614 | //
615 | this.saveFileDialog1.Title = "Export File";
616 | //
617 | // Manager
618 | //
619 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
620 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
621 | this.ClientSize = new System.Drawing.Size(1173, 665);
622 | this.Controls.Add(this.splitContainer2);
623 | this.Controls.Add(this.panel1);
624 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
625 | this.Name = "Manager";
626 | this.Text = "Ampy File Manager";
627 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Manager_FormClosing);
628 | this.Load += new System.EventHandler(this.Manager_Load);
629 | this.panel1.ResumeLayout(false);
630 | this.panel5.ResumeLayout(false);
631 | this.panel5.PerformLayout();
632 | this.splitContainer1.Panel1.ResumeLayout(false);
633 | this.splitContainer1.Panel2.ResumeLayout(false);
634 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
635 | this.splitContainer1.ResumeLayout(false);
636 | this.panel3.ResumeLayout(false);
637 | this.panel6.ResumeLayout(false);
638 | this.panel6.PerformLayout();
639 | this.panel2.ResumeLayout(false);
640 | this.panel10.ResumeLayout(false);
641 | this.panel9.ResumeLayout(false);
642 | this.panel9.PerformLayout();
643 | this.splitContainer2.Panel1.ResumeLayout(false);
644 | this.splitContainer2.Panel2.ResumeLayout(false);
645 | this.splitContainer2.Panel2.PerformLayout();
646 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
647 | this.splitContainer2.ResumeLayout(false);
648 | this.contextMenuStrip1.ResumeLayout(false);
649 | this.panel4.ResumeLayout(false);
650 | this.panel7.ResumeLayout(false);
651 | ((System.ComponentModel.ISupportInitialize)(this.picCommStatus)).EndInit();
652 | this.ResumeLayout(false);
653 |
654 | }
655 |
656 | #endregion
657 |
658 | private System.Windows.Forms.Panel panel1;
659 | private System.Windows.Forms.SplitContainer splitContainer1;
660 | private System.Windows.Forms.ListBox lstDirectory;
661 | private System.Windows.Forms.Panel panel3;
662 | private ScintillaNET.Scintilla scintilla1;
663 | private System.Windows.Forms.Panel panel2;
664 | private System.Windows.Forms.Label label1;
665 | private System.Windows.Forms.Button btnOpen;
666 | private System.Windows.Forms.Button btnNew;
667 | private System.Windows.Forms.Button btnLoad;
668 | private System.Windows.Forms.Button btnDelete;
669 | private System.Windows.Forms.Button btnBackup;
670 | private System.Windows.Forms.OpenFileDialog openFileDialog1;
671 | private System.Windows.Forms.Button btnMkdir;
672 | private System.IO.Ports.SerialPort serialPort1;
673 | private System.Windows.Forms.SplitContainer splitContainer2;
674 | private System.Windows.Forms.TextBox txtTerminal;
675 | private System.Windows.Forms.Panel panel4;
676 | private System.Windows.Forms.Button btnControlD;
677 | private System.Windows.Forms.Button btnControlC;
678 | private System.Windows.Forms.Timer tmrCommStatus;
679 | private System.Windows.Forms.Button btnRefresh;
680 | private System.Windows.Forms.Panel panel5;
681 | private System.Windows.Forms.Button btnChangeMode;
682 | private System.Windows.Forms.Label lblCurrentDirectory;
683 | private System.Windows.Forms.Panel panel6;
684 | private System.Windows.Forms.Label lblCurrentFile;
685 | private System.Windows.Forms.Panel panel10;
686 | private System.Windows.Forms.Button btnSaveAs;
687 | private System.Windows.Forms.Button btnSave;
688 | private System.Windows.Forms.Panel panel9;
689 | private System.Windows.Forms.Label label2;
690 | private System.Windows.Forms.Panel panel7;
691 | private System.Windows.Forms.PictureBox picCommStatus;
692 | private System.Windows.Forms.ComboBox cboHelp;
693 | private System.Windows.Forms.Button btnLoadHelp;
694 | private System.Windows.Forms.Button btnRun;
695 | private System.Windows.Forms.Timer tmrRunCommand;
696 | private System.Windows.Forms.Button btnCustom;
697 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
698 | private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
699 | private System.Windows.Forms.Button btnMove;
700 | private System.Windows.Forms.SaveFileDialog saveFileDialog1;
701 | private System.Windows.Forms.Button btnExport;
702 | private System.Windows.Forms.Label label3;
703 | private System.Windows.Forms.ToolTip toolTip1;
704 | private System.Windows.Forms.Button btnReplaceAll;
705 | }
706 | }
--------------------------------------------------------------------------------
/AmpyFileManager/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace AmpyFileManager
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 |
20 | ESPRoutines ESP = new ESPRoutines();
21 | while (ESP.COMM_PORT == "")
22 | {
23 | MessageBox.Show("Must select the COM port your device is on.");
24 | ESP = new ESPRoutines();
25 | }
26 |
27 | if (ESP.COMM_PORT != "EXIT")
28 | Application.Run(new frmMain(ESP));
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/AmpyFileManager/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Ampy File Manager")]
9 | [assembly: AssemblyDescription("A Windows GUI Front End For The AMPY File Utility")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Ampy File Manager")]
13 | [assembly: AssemblyCopyright("Copyright © 2017-2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("4a453abe-30f7-4e20-81d5-49814a2b558d")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/AmpyFileManager/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AmpyFileManager.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AmpyFileManager.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/AmpyFileManager/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/AmpyFileManager/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AmpyFileManager.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("500")]
29 | public int WindowHeight {
30 | get {
31 | return ((int)(this["WindowHeight"]));
32 | }
33 | set {
34 | this["WindowHeight"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("600")]
41 | public int WindowWidth {
42 | get {
43 | return ((int)(this["WindowWidth"]));
44 | }
45 | set {
46 | this["WindowWidth"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("50")]
53 | public int WindowTop {
54 | get {
55 | return ((int)(this["WindowTop"]));
56 | }
57 | set {
58 | this["WindowTop"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("50")]
65 | public int WindowLeft {
66 | get {
67 | return ((int)(this["WindowLeft"]));
68 | }
69 | set {
70 | this["WindowLeft"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("400")]
77 | public int REPLHeight {
78 | get {
79 | return ((int)(this["REPLHeight"]));
80 | }
81 | set {
82 | this["REPLHeight"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("500")]
89 | public int REPLWidth {
90 | get {
91 | return ((int)(this["REPLWidth"]));
92 | }
93 | set {
94 | this["REPLWidth"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("60")]
101 | public int REPLTop {
102 | get {
103 | return ((int)(this["REPLTop"]));
104 | }
105 | set {
106 | this["REPLTop"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("60")]
113 | public int REPLLeft {
114 | get {
115 | return ((int)(this["REPLLeft"]));
116 | }
117 | set {
118 | this["REPLLeft"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("500")]
125 | public int HelpHeight {
126 | get {
127 | return ((int)(this["HelpHeight"]));
128 | }
129 | set {
130 | this["HelpHeight"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("600")]
137 | public int HelpWidth {
138 | get {
139 | return ((int)(this["HelpWidth"]));
140 | }
141 | set {
142 | this["HelpWidth"] = value;
143 | }
144 | }
145 |
146 | [global::System.Configuration.UserScopedSettingAttribute()]
147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
148 | [global::System.Configuration.DefaultSettingValueAttribute("50")]
149 | public int HelpLeft {
150 | get {
151 | return ((int)(this["HelpLeft"]));
152 | }
153 | set {
154 | this["HelpLeft"] = value;
155 | }
156 | }
157 |
158 | [global::System.Configuration.UserScopedSettingAttribute()]
159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
160 | [global::System.Configuration.DefaultSettingValueAttribute("50")]
161 | public int HelpTop {
162 | get {
163 | return ((int)(this["HelpTop"]));
164 | }
165 | set {
166 | this["HelpTop"] = value;
167 | }
168 | }
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/AmpyFileManager/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 500
7 |
8 |
9 | 600
10 |
11 |
12 | 50
13 |
14 |
15 | 50
16 |
17 |
18 | 400
19 |
20 |
21 | 500
22 |
23 |
24 | 60
25 |
26 |
27 | 60
28 |
29 |
30 | 500
31 |
32 |
33 | 600
34 |
35 |
36 | 50
37 |
38 |
39 | 50
40 |
41 |
42 |
--------------------------------------------------------------------------------
/AmpyFileManager/RebexAboutForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace AmpyFileManager
2 | {
3 | partial class RebexAboutForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RebexAboutForm));
32 | this.lnkRebexTerminalComponent = new System.Windows.Forms.LinkLabel();
33 | this.label1 = new System.Windows.Forms.Label();
34 | this.textBox1 = new System.Windows.Forms.TextBox();
35 | this.btnOK = new System.Windows.Forms.Button();
36 | this.SuspendLayout();
37 | //
38 | // lnkRebexTerminalComponent
39 | //
40 | this.lnkRebexTerminalComponent.AutoSize = true;
41 | this.lnkRebexTerminalComponent.Location = new System.Drawing.Point(138, 37);
42 | this.lnkRebexTerminalComponent.Name = "lnkRebexTerminalComponent";
43 | this.lnkRebexTerminalComponent.Size = new System.Drawing.Size(130, 13);
44 | this.lnkRebexTerminalComponent.TabIndex = 0;
45 | this.lnkRebexTerminalComponent.TabStop = true;
46 | this.lnkRebexTerminalComponent.Text = "Rebex Terminal Emulation";
47 | this.lnkRebexTerminalComponent.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkRebexTerminalComponent_LinkClicked);
48 | //
49 | // label1
50 | //
51 | this.label1.AutoSize = true;
52 | this.label1.Location = new System.Drawing.Point(13, 13);
53 | this.label1.Name = "label1";
54 | this.label1.Size = new System.Drawing.Size(388, 13);
55 | this.label1.TabIndex = 1;
56 | this.label1.Text = "This REPL serial terminal was created with the Rebex Terminal Emulation Library.";
57 | //
58 | // textBox1
59 | //
60 | this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
61 | this.textBox1.Location = new System.Drawing.Point(16, 63);
62 | this.textBox1.Multiline = true;
63 | this.textBox1.Name = "textBox1";
64 | this.textBox1.ReadOnly = true;
65 | this.textBox1.Size = new System.Drawing.Size(380, 139);
66 | this.textBox1.TabIndex = 2;
67 | this.textBox1.Text = resources.GetString("textBox1.Text");
68 | //
69 | // btnOK
70 | //
71 | this.btnOK.Location = new System.Drawing.Point(163, 208);
72 | this.btnOK.Name = "btnOK";
73 | this.btnOK.Size = new System.Drawing.Size(75, 23);
74 | this.btnOK.TabIndex = 3;
75 | this.btnOK.Text = "OK";
76 | this.btnOK.UseVisualStyleBackColor = true;
77 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
78 | //
79 | // RebexAboutForm
80 | //
81 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
82 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
83 | this.ClientSize = new System.Drawing.Size(408, 240);
84 | this.Controls.Add(this.btnOK);
85 | this.Controls.Add(this.textBox1);
86 | this.Controls.Add(this.label1);
87 | this.Controls.Add(this.lnkRebexTerminalComponent);
88 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
89 | this.MaximizeBox = false;
90 | this.MinimizeBox = false;
91 | this.Name = "RebexAboutForm";
92 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
93 | this.Text = "About Rebex Terminal Emulation";
94 | this.ResumeLayout(false);
95 | this.PerformLayout();
96 |
97 | }
98 |
99 | #endregion
100 |
101 | private System.Windows.Forms.LinkLabel lnkRebexTerminalComponent;
102 | private System.Windows.Forms.Label label1;
103 | private System.Windows.Forms.TextBox textBox1;
104 | private System.Windows.Forms.Button btnOK;
105 | }
106 | }
--------------------------------------------------------------------------------
/AmpyFileManager/RebexAboutForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace AmpyFileManager
12 | {
13 | public partial class RebexAboutForm : Form
14 | {
15 | public RebexAboutForm()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void lnkRebexTerminalComponent_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
21 | {
22 | HelpForm help = new HelpForm();
23 | help.Text = "Rebex Terminal Emulation Library";
24 | ((WebBrowser)help.Controls["webBrowser1"]).Url = new Uri("https://www.rebex.net/terminal-emulation.net/");
25 | help.Show();
26 | }
27 |
28 | private void btnOK_Click(object sender, EventArgs e)
29 | {
30 | this.Close();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/AmpyFileManager/RebexAboutForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | It is nice because it supports full ANSI terminal commands so it can be used with the 'pye.py' script to edit files in the terminal window. It also has full support of all the MicroPython REPL key functions such as CTRL-E for 'Paste' mode. All of this was easy enough to implement in an afternoon, with very little actual coding needed.
122 |
123 | But this turns out to only cover the core functionality of the library. It's actually meant to make implementing full blown SSH and Telnet clients a breeze. That's not needed here, but if you are looking for that kind of functionality, I highly recommend giving the Rebex library a try.
124 |
125 |
--------------------------------------------------------------------------------
/AmpyFileManager/RebexForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace AmpyFileManager
2 | {
3 | partial class RebexForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RebexForm));
33 | this.terminalControl1 = new Rebex.TerminalEmulation.TerminalControl();
34 | this.timer1 = new System.Windows.Forms.Timer(this.components);
35 | this.menuStrip1 = new System.Windows.Forms.MenuStrip();
36 | this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
37 | this.resetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
38 | this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
39 | this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40 | this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
41 | this.menuStrip1.SuspendLayout();
42 | this.SuspendLayout();
43 | //
44 | // terminalControl1
45 | //
46 | this.terminalControl1.BackColor = System.Drawing.Color.BlanchedAlmond;
47 | this.terminalControl1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
48 | this.terminalControl1.Cursor = System.Windows.Forms.Cursors.IBeam;
49 | this.terminalControl1.CursorMouse = System.Windows.Forms.Cursors.Arrow;
50 | this.terminalControl1.CursorText = System.Windows.Forms.Cursors.IBeam;
51 | this.terminalControl1.Dock = System.Windows.Forms.DockStyle.Fill;
52 | this.terminalControl1.HistoryMaxLength = 256;
53 | this.terminalControl1.Location = new System.Drawing.Point(0, 24);
54 | this.terminalControl1.Name = "terminalControl1";
55 | this.terminalControl1.Options.ColorScheme = Rebex.TerminalEmulation.ColorScheme.Monochrome;
56 | this.terminalControl1.Recorder = null;
57 | this.terminalControl1.Size = new System.Drawing.Size(835, 502);
58 | this.terminalControl1.TabIndex = 0;
59 | //
60 | // timer1
61 | //
62 | this.timer1.Interval = 500;
63 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
64 | //
65 | // menuStrip1
66 | //
67 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
68 | this.terminalToolStripMenuItem,
69 | this.aboutToolStripMenuItem});
70 | this.menuStrip1.Location = new System.Drawing.Point(0, 0);
71 | this.menuStrip1.Name = "menuStrip1";
72 | this.menuStrip1.Size = new System.Drawing.Size(835, 24);
73 | this.menuStrip1.TabIndex = 1;
74 | this.menuStrip1.Text = "menuStrip1";
75 | //
76 | // terminalToolStripMenuItem
77 | //
78 | this.terminalToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
79 | this.resetToolStripMenuItem,
80 | this.toolStripMenuItem1,
81 | this.closeToolStripMenuItem});
82 | this.terminalToolStripMenuItem.Name = "terminalToolStripMenuItem";
83 | this.terminalToolStripMenuItem.Size = new System.Drawing.Size(65, 20);
84 | this.terminalToolStripMenuItem.Text = "Terminal";
85 | //
86 | // resetToolStripMenuItem
87 | //
88 | this.resetToolStripMenuItem.Name = "resetToolStripMenuItem";
89 | this.resetToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
90 | this.resetToolStripMenuItem.Text = "Reset";
91 | this.resetToolStripMenuItem.Click += new System.EventHandler(this.resetToolStripMenuItem_Click);
92 | //
93 | // toolStripMenuItem1
94 | //
95 | this.toolStripMenuItem1.Name = "toolStripMenuItem1";
96 | this.toolStripMenuItem1.Size = new System.Drawing.Size(177, 6);
97 | //
98 | // closeToolStripMenuItem
99 | //
100 | this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
101 | this.closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
102 | this.closeToolStripMenuItem.Text = "Close";
103 | this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
104 | //
105 | // aboutToolStripMenuItem
106 | //
107 | this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
108 | this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
109 | this.aboutToolStripMenuItem.Text = "About";
110 | this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
111 | //
112 | // REPLForm
113 | //
114 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
115 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
116 | this.ClientSize = new System.Drawing.Size(835, 526);
117 | this.Controls.Add(this.terminalControl1);
118 | this.Controls.Add(this.menuStrip1);
119 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
120 | this.MainMenuStrip = this.menuStrip1;
121 | this.MinimizeBox = false;
122 | this.Name = "REPLForm";
123 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
124 | this.Text = "MicroPython REPL";
125 | this.Activated += new System.EventHandler(this.REPLForm_Activated);
126 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.REPLForm_FormClosing);
127 | this.Load += new System.EventHandler(this.REPLForm_Load);
128 | this.menuStrip1.ResumeLayout(false);
129 | this.menuStrip1.PerformLayout();
130 | this.ResumeLayout(false);
131 | this.PerformLayout();
132 |
133 | }
134 |
135 | #endregion
136 |
137 | private Rebex.TerminalEmulation.TerminalControl terminalControl1;
138 | private System.Windows.Forms.Timer timer1;
139 | private System.Windows.Forms.MenuStrip menuStrip1;
140 | private System.Windows.Forms.ToolStripMenuItem terminalToolStripMenuItem;
141 | private System.Windows.Forms.ToolStripMenuItem resetToolStripMenuItem;
142 | private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
143 | private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
144 | private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
145 | }
146 | }
--------------------------------------------------------------------------------
/AmpyFileManager/RebexForm.cs:
--------------------------------------------------------------------------------
1 | using AmpyFileManager.Properties;
2 | using Rebex.TerminalEmulation;
3 | using System;
4 | using System.Configuration;
5 | using System.Drawing;
6 | using System.Windows.Forms;
7 |
8 | namespace AmpyFileManager
9 | {
10 | public partial class RebexForm : Form
11 | {
12 | private SerialPortChannel _serialPort = null;
13 | private string _comPort = string.Empty;
14 | private int _baudRate = 115200;
15 | private string _command = string.Empty;
16 | private bool _initialized = false;
17 |
18 | public RebexForm(string ComPort, int BaudRate, string Command)
19 | {
20 | InitializeComponent();
21 |
22 | _comPort = ComPort;
23 | _baudRate = BaudRate;
24 | _command = Command;
25 |
26 | this.DialogResult = DialogResult.No;
27 | }
28 |
29 | private void REPLForm_Load(object sender, EventArgs e)
30 | {
31 | RestoreWindow();
32 | }
33 |
34 | private void REPLForm_Activated(object sender, EventArgs e)
35 | {
36 | if (!_initialized)
37 | timer1.Enabled = true;
38 | }
39 |
40 | private void timer1_Tick(object sender, EventArgs e)
41 | {
42 | timer1.Enabled = false;
43 |
44 | // setup font styling of terminal control
45 | terminalControl1.Font = new Font(ConfigurationManager.AppSettings["TerminalFont"], Convert.ToSingle(ConfigurationManager.AppSettings["TerminalFontSize"]), FontStyle.Bold);
46 |
47 | // create a new Serial port object
48 | _serialPort = new SerialPortChannel(_comPort, _baudRate);
49 |
50 | // bind the Serial port instance to the terminal console
51 | terminalControl1.Bind(_serialPort);
52 |
53 | // execute any pre-defined command
54 | Scripting scripting = terminalControl1.Scripting;
55 | scripting.Send("\r");
56 | if (!String.IsNullOrEmpty(_command))
57 | scripting.Send(_command + "\r");
58 |
59 | _initialized = true;
60 | }
61 |
62 | private void resetToolStripMenuItem_Click(object sender, EventArgs e)
63 | {
64 | this.DialogResult = DialogResult.Yes;
65 | this.Close();
66 | }
67 |
68 | private void closeToolStripMenuItem_Click(object sender, EventArgs e)
69 | {
70 | this.Close();
71 | }
72 |
73 | private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
74 | {
75 | RebexAboutForm aboutForm = new RebexAboutForm();
76 | aboutForm.ShowDialog();
77 | }
78 |
79 | private void REPLForm_FormClosing(object sender, FormClosingEventArgs e)
80 | {
81 | terminalControl1.Unbind();
82 | SaveWindow();
83 | }
84 |
85 | private void RestoreWindow()
86 | {
87 | Width = Settings.Default.REPLWidth;
88 | Height = Settings.Default.REPLHeight;
89 | Top = Settings.Default.REPLTop < 0 ? 0 : Settings.Default.REPLTop;
90 | Left = Settings.Default.REPLLeft < 0 ? 0 : Settings.Default.REPLLeft;
91 | }
92 |
93 | private void SaveWindow()
94 | {
95 | Settings.Default.REPLHeight = Height;
96 | Settings.Default.REPLWidth = Width;
97 | Settings.Default.REPLLeft = Left;
98 | Settings.Default.REPLTop = Top;
99 | Settings.Default.Save();
100 | }
101 |
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/AmpyFileManager/ReplaceAllForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace AmpyFileManager
2 | {
3 | partial class ReplaceAllForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.txtFind = new System.Windows.Forms.TextBox();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.txtReplace = new System.Windows.Forms.TextBox();
35 | this.button1 = new System.Windows.Forms.Button();
36 | this.button2 = new System.Windows.Forms.Button();
37 | this.label3 = new System.Windows.Forms.Label();
38 | this.SuspendLayout();
39 | //
40 | // label1
41 | //
42 | this.label1.AutoSize = true;
43 | this.label1.Location = new System.Drawing.Point(48, 11);
44 | this.label1.Name = "label1";
45 | this.label1.Size = new System.Drawing.Size(30, 13);
46 | this.label1.TabIndex = 0;
47 | this.label1.Text = "Find:";
48 | //
49 | // txtFind
50 | //
51 | this.txtFind.Location = new System.Drawing.Point(84, 8);
52 | this.txtFind.Name = "txtFind";
53 | this.txtFind.Size = new System.Drawing.Size(164, 20);
54 | this.txtFind.TabIndex = 1;
55 | //
56 | // label2
57 | //
58 | this.label2.AutoSize = true;
59 | this.label2.Location = new System.Drawing.Point(3, 37);
60 | this.label2.Name = "label2";
61 | this.label2.Size = new System.Drawing.Size(75, 13);
62 | this.label2.TabIndex = 2;
63 | this.label2.Text = "Replace With:";
64 | //
65 | // txtReplace
66 | //
67 | this.txtReplace.Location = new System.Drawing.Point(84, 34);
68 | this.txtReplace.Name = "txtReplace";
69 | this.txtReplace.Size = new System.Drawing.Size(164, 20);
70 | this.txtReplace.TabIndex = 3;
71 | //
72 | // button1
73 | //
74 | this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
75 | this.button1.Location = new System.Drawing.Point(266, 5);
76 | this.button1.Name = "button1";
77 | this.button1.Size = new System.Drawing.Size(75, 23);
78 | this.button1.TabIndex = 4;
79 | this.button1.Text = "Replace";
80 | this.button1.UseVisualStyleBackColor = true;
81 | //
82 | // button2
83 | //
84 | this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
85 | this.button2.Location = new System.Drawing.Point(266, 34);
86 | this.button2.Name = "button2";
87 | this.button2.Size = new System.Drawing.Size(75, 23);
88 | this.button2.TabIndex = 5;
89 | this.button2.Text = "Cancel";
90 | this.button2.UseVisualStyleBackColor = true;
91 | //
92 | // label3
93 | //
94 | this.label3.AutoSize = true;
95 | this.label3.Location = new System.Drawing.Point(84, 64);
96 | this.label3.Name = "label3";
97 | this.label3.Size = new System.Drawing.Size(139, 13);
98 | this.label3.TabIndex = 6;
99 | this.label3.Text = "\\t = TAB \\r = CR \\n = LF";
100 | //
101 | // ReplaceAllForm
102 | //
103 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
104 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
105 | this.ClientSize = new System.Drawing.Size(353, 89);
106 | this.Controls.Add(this.label3);
107 | this.Controls.Add(this.button2);
108 | this.Controls.Add(this.button1);
109 | this.Controls.Add(this.txtReplace);
110 | this.Controls.Add(this.label2);
111 | this.Controls.Add(this.txtFind);
112 | this.Controls.Add(this.label1);
113 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
114 | this.MaximizeBox = false;
115 | this.MinimizeBox = false;
116 | this.Name = "ReplaceAllForm";
117 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
118 | this.Text = "Replace All";
119 | this.ResumeLayout(false);
120 | this.PerformLayout();
121 |
122 | }
123 |
124 | #endregion
125 |
126 | private System.Windows.Forms.Label label1;
127 | private System.Windows.Forms.TextBox txtFind;
128 | private System.Windows.Forms.Label label2;
129 | private System.Windows.Forms.TextBox txtReplace;
130 | private System.Windows.Forms.Button button1;
131 | private System.Windows.Forms.Button button2;
132 | private System.Windows.Forms.Label label3;
133 | }
134 | }
--------------------------------------------------------------------------------
/AmpyFileManager/ReplaceAllForm.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 |
3 | namespace AmpyFileManager
4 | {
5 | public partial class ReplaceAllForm : Form
6 | {
7 | public ReplaceAllForm()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/AmpyFileManager/ReplaceAllForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/AmpyFileManager/SelectComForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace AmpyFileManager
2 | {
3 | partial class SelectComForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.cboPorts = new System.Windows.Forms.ComboBox();
33 | this.btnOK = new System.Windows.Forms.Button();
34 | this.SuspendLayout();
35 | //
36 | // label1
37 | //
38 | this.label1.AutoSize = true;
39 | this.label1.Location = new System.Drawing.Point(34, 13);
40 | this.label1.Name = "label1";
41 | this.label1.Size = new System.Drawing.Size(63, 13);
42 | this.label1.TabIndex = 0;
43 | this.label1.Text = "Comm Ports";
44 | //
45 | // cboPorts
46 | //
47 | this.cboPorts.FormattingEnabled = true;
48 | this.cboPorts.Location = new System.Drawing.Point(37, 30);
49 | this.cboPorts.Name = "cboPorts";
50 | this.cboPorts.Size = new System.Drawing.Size(121, 21);
51 | this.cboPorts.TabIndex = 1;
52 | //
53 | // btnOK
54 | //
55 | this.btnOK.Location = new System.Drawing.Point(59, 65);
56 | this.btnOK.Name = "btnOK";
57 | this.btnOK.Size = new System.Drawing.Size(75, 23);
58 | this.btnOK.TabIndex = 2;
59 | this.btnOK.Text = "OK";
60 | this.btnOK.UseVisualStyleBackColor = true;
61 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
62 | //
63 | // SelectComForm
64 | //
65 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
66 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
67 | this.ClientSize = new System.Drawing.Size(196, 100);
68 | this.Controls.Add(this.btnOK);
69 | this.Controls.Add(this.cboPorts);
70 | this.Controls.Add(this.label1);
71 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
72 | this.MaximizeBox = false;
73 | this.MinimizeBox = false;
74 | this.Name = "SelectComForm";
75 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
76 | this.Text = "Select Comm Port";
77 | this.Load += new System.EventHandler(this.SelectCom_Load);
78 | this.ResumeLayout(false);
79 | this.PerformLayout();
80 |
81 | }
82 |
83 | #endregion
84 |
85 | private System.Windows.Forms.Label label1;
86 | private System.Windows.Forms.ComboBox cboPorts;
87 | private System.Windows.Forms.Button btnOK;
88 | }
89 | }
--------------------------------------------------------------------------------
/AmpyFileManager/SelectComForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO.Ports;
3 | using System.Data;
4 | using System.Linq;
5 | using System.Windows.Forms;
6 |
7 | namespace AmpyFileManager
8 | {
9 | public partial class SelectComForm : Form
10 | {
11 | public string SELECTED_COMM_PORT = "EXIT";
12 |
13 | public SelectComForm()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private void SelectCom_Load(object sender, EventArgs e)
19 | {
20 | //cboPorts.Items.Clear();
21 | //string[] ports = SerialPort.GetPortNames().OrderBy(s => Convert.ToInt32(s.Substring(3))).ToArray();
22 | //foreach (string port in ports)
23 | // cboPorts.Items.Add(port);
24 | }
25 |
26 | private void btnOK_Click(object sender, EventArgs e)
27 | {
28 | SELECTED_COMM_PORT = cboPorts.Text;
29 | this.Close();
30 | }
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/AmpyFileManager/SelectComForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/AmpyFileManager/TerminalForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace AmpyFileManager
2 | {
3 | partial class TerminalForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TerminalForm));
33 | this.txtDisplay = new System.Windows.Forms.TextBox();
34 | this.serialPort1 = new System.IO.Ports.SerialPort(this.components);
35 | this.timer1 = new System.Windows.Forms.Timer(this.components);
36 | this.SuspendLayout();
37 | //
38 | // txtDisplay
39 | //
40 | this.txtDisplay.AcceptsTab = true;
41 | this.txtDisplay.BackColor = System.Drawing.Color.Black;
42 | this.txtDisplay.Dock = System.Windows.Forms.DockStyle.Fill;
43 | this.txtDisplay.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
44 | this.txtDisplay.ForeColor = System.Drawing.Color.DarkSeaGreen;
45 | this.txtDisplay.HideSelection = false;
46 | this.txtDisplay.Location = new System.Drawing.Point(0, 0);
47 | this.txtDisplay.Multiline = true;
48 | this.txtDisplay.Name = "txtDisplay";
49 | this.txtDisplay.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
50 | this.txtDisplay.Size = new System.Drawing.Size(955, 553);
51 | this.txtDisplay.TabIndex = 0;
52 | this.txtDisplay.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDisplay_KeyDown);
53 | this.txtDisplay.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDisplay_KeyPress);
54 | this.txtDisplay.MouseMove += new System.Windows.Forms.MouseEventHandler(this.txtDisplay_MouseMove);
55 | this.txtDisplay.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.txtDisplay_PreviewKeyDown);
56 | //
57 | // serialPort1
58 | //
59 | this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived);
60 | //
61 | // timer1
62 | //
63 | this.timer1.Interval = 2000;
64 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
65 | //
66 | // TerminalForm
67 | //
68 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
69 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
70 | this.ClientSize = new System.Drawing.Size(955, 553);
71 | this.Controls.Add(this.txtDisplay);
72 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
73 | this.Name = "TerminalForm";
74 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
75 | this.Text = "MicroPython REPL";
76 | this.Activated += new System.EventHandler(this.TerminalForm_Activated);
77 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TerminalForm_FormClosing);
78 | this.Load += new System.EventHandler(this.TerminalForm_Load);
79 | this.ResumeLayout(false);
80 | this.PerformLayout();
81 |
82 | }
83 |
84 | #endregion
85 |
86 | private System.Windows.Forms.TextBox txtDisplay;
87 | private System.IO.Ports.SerialPort serialPort1;
88 | private System.Windows.Forms.Timer timer1;
89 | }
90 | }
--------------------------------------------------------------------------------
/AmpyFileManager/TerminalForm.cs:
--------------------------------------------------------------------------------
1 | using AmpyFileManager.Properties;
2 | using System;
3 | using System.Configuration;
4 | using System.Diagnostics;
5 | using System.Drawing;
6 | using System.Windows.Forms;
7 |
8 | namespace AmpyFileManager
9 | {
10 | public partial class TerminalForm : Form
11 | {
12 | private string _command = string.Empty;
13 | private bool _command_run = false;
14 | private string _readBuffer = string.Empty;
15 | private int _bufferLimit = 16384;
16 | private int _bufferResetSize = 2048;
17 |
18 | public TerminalForm(string ComPort, int BaudRate, string Command)
19 | {
20 | InitializeComponent();
21 | serialPort1.PortName = ComPort;
22 | serialPort1.BaudRate = BaudRate;
23 | _command = Command;
24 | }
25 |
26 | private void TerminalForm_Load(object sender, EventArgs e)
27 | {
28 | txtDisplay.Font = new Font(ConfigurationManager.AppSettings["TerminalFont"], Convert.ToSingle(ConfigurationManager.AppSettings["TerminalFontSize"]), FontStyle.Bold);
29 | txtDisplay.BackColor = DecodeColor("TerminalBackColor");
30 | txtDisplay.ForeColor = DecodeColor("TerminalForeColor");
31 |
32 | GetWindowValue();
33 | }
34 |
35 | private void TerminalForm_Activated(object sender, EventArgs e)
36 | {
37 | if (!serialPort1.IsOpen)
38 | serialPort1.Open();
39 | if (!_command_run)
40 | timer1.Enabled = true;
41 | }
42 |
43 | private void timer1_Tick(object sender, EventArgs e)
44 | {
45 | timer1.Enabled = false;
46 | if (!String.IsNullOrEmpty(_command) && serialPort1.IsOpen)
47 | {
48 | serialPort1.Write(_command);
49 | serialPort1.Write("\r");
50 | }
51 | _command_run = true;
52 | }
53 |
54 | private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
55 | {
56 | try
57 | {
58 | _readBuffer = serialPort1.ReadExisting();
59 | this.Invoke(new EventHandler(DoUpdate));
60 | }
61 | catch (Exception ex)
62 | {
63 | MessageBox.Show(ex.Message, "serialPort1_DataReceived() Error");
64 | }
65 | }
66 |
67 | private void txtDisplay_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
68 | {
69 | if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)
70 | e.IsInputKey = true;
71 | }
72 |
73 | private void txtDisplay_MouseMove(object sender, MouseEventArgs e)
74 | {
75 | txtDisplay.SelectionLength = 0;
76 | }
77 |
78 | private void txtDisplay_KeyDown(object sender, KeyEventArgs e)
79 | {
80 | if (e.KeyCode == Keys.Up)
81 | {
82 | byte[] b = { 27, 91, 65 };
83 | serialPort1.Write(b, 0, 3);
84 | }
85 | else if (e.KeyCode == Keys.Down)
86 | {
87 | byte[] b = { 27, 91, 66 };
88 | serialPort1.Write(b, 0, 3);
89 | }
90 | else if (e.KeyCode == Keys.Tab)
91 | {
92 | serialPort1.Write("\t");
93 | }
94 | else if ((e.KeyCode == Keys.V && e.Control) || (e.KeyCode == Keys.Insert && e.Shift))
95 | {
96 | serialPort1.Write(Clipboard.GetText());
97 | }
98 | }
99 |
100 | private void txtDisplay_KeyPress(object sender, KeyPressEventArgs e)
101 | {
102 | try
103 | {
104 | char[] key = new char[1];
105 | key[0] = e.KeyChar;
106 | serialPort1.Write(key, 0, 1);
107 | e.Handled = true;
108 | }
109 | catch (Exception ex)
110 | {
111 | Debug.WriteLine(ex.Message);
112 | }
113 | }
114 |
115 | private void TerminalForm_FormClosing(object sender, FormClosingEventArgs e)
116 | {
117 | serialPort1.Close();
118 | SaveWindowValue();
119 | }
120 |
121 | public void DoUpdate(object sender, System.EventArgs e)
122 | {
123 | try
124 | {
125 | if (!String.IsNullOrEmpty(_readBuffer))
126 | {
127 | // process a single backspace
128 | if (_readBuffer == "\b\u001b[K")
129 | {
130 | txtDisplay.SelectionStart = txtDisplay.Text.Length - 1;
131 | txtDisplay.SelectionLength = 1;
132 | txtDisplay.SelectedText = "";
133 | }
134 | else if (_readBuffer[0] == 27 && _readBuffer[1] == 91) // else if it begins with an escape sequence...
135 | {
136 | string cmd = _readBuffer.Substring(2);
137 | //MessageBox.Show(cmd);
138 | int pos = cmd.IndexOf('D');
139 | if (pos > 0)
140 | {
141 | string countstr = cmd.Substring(0, pos);
142 | int count = Convert.ToInt16(countstr);
143 | if (count > 0)
144 | {
145 | txtDisplay.SelectionStart = txtDisplay.Text.Length - count;
146 | txtDisplay.SelectionLength = count;
147 | txtDisplay.SelectedText = "";
148 | }
149 | string remainder = cmd.Substring(pos + 1);
150 | if (remainder != "")
151 | {
152 | //MessageBox.Show(remainder);
153 | if (remainder == "\b\u001b[K")
154 | {
155 | txtDisplay.SelectionStart = txtDisplay.Text.Length - 1;
156 | txtDisplay.SelectionLength = 1;
157 | txtDisplay.SelectedText = "";
158 | }
159 | else
160 | {
161 | if (remainder[0] == 27 && remainder[1] == 91 && remainder[2] == 75)
162 | {
163 | txtDisplay.SelectionStart = txtDisplay.Text.Length;
164 | txtDisplay.SelectionLength = 0;
165 | txtDisplay.SelectedText = remainder.Substring(3);
166 | }
167 | else
168 | {
169 | txtDisplay.AppendText(remainder);
170 | txtDisplay.SelectionStart = txtDisplay.Text.Length;
171 | txtDisplay.SelectionLength = 0;
172 | txtDisplay.ScrollToCaret();
173 | }
174 | }
175 | }
176 | }
177 | else
178 | {
179 | if (cmd == "K")
180 | {
181 | txtDisplay.SelectionStart = txtDisplay.Text.Length - 1;
182 | txtDisplay.SelectionLength = 1;
183 | txtDisplay.SelectedText = "";
184 | }
185 | else
186 | MessageBox.Show(cmd);
187 | }
188 | }
189 | else // else it is just some text from the device
190 | {
191 | txtDisplay.AppendText(_readBuffer);
192 | txtDisplay.SelectionStart = txtDisplay.Text.Length;
193 | txtDisplay.SelectionLength = 0;
194 | txtDisplay.ScrollToCaret();
195 | }
196 |
197 | // truncate the terminal buffer
198 | if (txtDisplay.TextLength > _bufferLimit)
199 | {
200 | txtDisplay.Text = txtDisplay.Text.Substring(txtDisplay.TextLength - _bufferResetSize);
201 | }
202 |
203 | }
204 |
205 | }
206 | catch (Exception ex)
207 | {
208 | Debug.WriteLine("DoUpdate() Error:" + ex.Message);
209 | }
210 |
211 | }
212 |
213 | private Color DecodeColor(string ColorSettingName)
214 | {
215 | Color color = new Color();
216 |
217 | string ColorSetting = ConfigurationManager.AppSettings[ColorSettingName];
218 |
219 | if (ColorSetting.Contains(","))
220 | {
221 | string[] rgb = ColorSetting.Split(',');
222 | color = Color.FromArgb(Convert.ToInt32(rgb[0]), Convert.ToInt32(rgb[1]), Convert.ToInt32(rgb[2]));
223 | }
224 | else
225 | color = Color.FromName(ColorSetting);
226 |
227 | return color;
228 | }
229 |
230 | private void GetWindowValue()
231 | {
232 | Width = Settings.Default.REPLWidth;
233 | Height = Settings.Default.REPLHeight;
234 | Top = Settings.Default.REPLTop < 0 ? 0 : Settings.Default.REPLTop;
235 | Left = Settings.Default.REPLLeft < 0 ? 0 : Settings.Default.REPLLeft;
236 | }
237 |
238 | private void SaveWindowValue()
239 | {
240 | Settings.Default.REPLHeight = Height;
241 | Settings.Default.REPLWidth = Width;
242 | Settings.Default.REPLLeft = Left;
243 | Settings.Default.REPLTop = Top;
244 | Settings.Default.Save();
245 | }
246 |
247 | }
248 | }
249 |
--------------------------------------------------------------------------------
/AmpyFileManager/esp8266.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joewez/AmpyFileManager/33009c257e7a40af27e72af16b960b721b13d39a/AmpyFileManager/esp8266.ico
--------------------------------------------------------------------------------
/AmpyFileManager/help/WemosD1MiniMicropythonPins.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joewez/AmpyFileManager/33009c257e7a40af27e72af16b960b721b13d39a/AmpyFileManager/help/WemosD1MiniMicropythonPins.png
--------------------------------------------------------------------------------
/AmpyFileManager/help/cheatsheet-back.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joewez/AmpyFileManager/33009c257e7a40af27e72af16b960b721b13d39a/AmpyFileManager/help/cheatsheet-back.jpg
--------------------------------------------------------------------------------
/AmpyFileManager/help/cheatsheet-front.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joewez/AmpyFileManager/33009c257e7a40af27e72af16b960b721b13d39a/AmpyFileManager/help/cheatsheet-front.jpg
--------------------------------------------------------------------------------
/AmpyFileManager/if_address_book_16600.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joewez/AmpyFileManager/33009c257e7a40af27e72af16b960b721b13d39a/AmpyFileManager/if_address_book_16600.ico
--------------------------------------------------------------------------------
/AmpyFileManager/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Ampy File Manager
2 | Windows GUI for the Adafruit MicroPython Utility
3 |
4 |
5 |
6 |
7 | A simple GUI wrapper that executes the AMPY (https://github.com/scientifichackers/ampy) command to manipulate the files on an ESP8266 board running MicroPython.
8 |
9 | It was written in C# in Visual Studio 2019, so you will need VS Express or better to compile it. It uses the Scintilla editor control (https://github.com/jacobslusser/ScintillaNET) which allows for MicroPython syntax highlighting.
10 |
11 | As a development tool, I wrote the utility to mainly just edit the files directly off of the device. I have also embedded a simple terminal emulator to send commands to the serial REPL. The program works better though when paired with an external terminal such as puTTY or TeraTerm. See the configuration notes below on how to set this up.
12 |
13 | A precompiled binary is available for download here:
14 |
15 | http://wezensky.no-ip.org/shared/afm.zip
16 |
17 | Just unzip to a convenient location and run the AmpyFileManager.exe. NOTE: The latest .Net Framework is required for this application to run.
18 |
19 | HOW TO START:
20 |
21 | - Plug your MicroPython device into your computer and determine what com port it was assigned to
22 | - Start the application.
23 | - Select the com port for your device (if there is more than one)
24 | - The main window should appear with the files on the root of the device listed
25 | - If there was a problem and the files were not listed, click on the Refresh button
26 | (If you still do not see any files on your device your version of AMPY may be incompatible. See below.)
27 |
28 | HOW TO USE:
29 |
30 | All the features are pretty self-explanatory, but here is just a short description of it's general use.
31 |
32 | - Navigation
33 | - To open a file for viewing or editing, select the file and click "Open" (or just double-click the filename)
34 | - To go into a sub-folder select the folder and click "Open" (or just double-click the folder name)
35 | - To go back one directory click on the [..] entry at the top of the file list
36 |
37 | - Main Commands
38 | - New will prepare a new file for editing
39 | - Open will open a file for editing or change the directory
40 | - Load will allow you to import a file from your computer
41 | - Export will save the selected file to your computer
42 | - Delete will delete the file or directory from the device
43 | - Move will move (rename) the selected file
44 | - MKDIR will allow you to create a sub-folder
45 | - Refresh will re-read the file list of the current directory
46 | - Run will attempt to import/run the selected file
47 | - REPL will open a MicroPython REPL window
48 |
49 | - Editing Commands
50 | - Replace All will do a simple search and replace on the current file being edited
51 | - Save As will save the current file to the device using the name you give it in the current directory
52 | - Save will save the current file to the device
53 |
54 | ADDITIONAL INFO:
55 |
56 | - AMPY is an active project and as such, will change in a way that sometimes breaks this application.
57 | Currently this application is compatible with version 1.0.7.
58 | - Configuration setting are located in the AmpyFilemanager.exe.config file
59 | - The application defaults to 115200 baud for serial communications
60 | - Most settings are self-explanatory
61 | - If ExternalTerminal is set to "Y" the TerminalApp, TerminalAppArgs and
62 | TerminalAppTitle settings are used
63 | - TerminalApp is the EXE to run
64 | - TerminalAppArgs are the arguments to run the terminal app with
65 | - The term {PORT} in this setting will be replaced at runtime with the current port
66 | - The term {PORTNUM} in this setting will be replaced at runtime with the current port number
67 | - TerminalAppTitle is the title of the external window
68 | - Example:
69 |
70 |
71 | <add key="ExternalTerminal" value="Y" />
72 | <add key="TerminalApp" value="putty" />
73 | <add key="TerminalAppArgs" value="-load "repl" -serial {PORT}" />
74 | <add key="TerminalAppTitle" value="PuTTY" />
75 |
76 |
77 | Invokes the putty.exe application and uses the "repl" session
78 | - The EditExtensions setting determines what types of files are editable (text)
79 | - The SaveDir setting determines where session files are created, if blank the EXE location is used
80 | - UniqueSessions indicates if a single session directory is used or a new one for each program start
81 | - The "session" directory is where a file is stored while being edited
82 | - Color settings may be a WebColor name or a 3 value, comma-separated list of the RGB values to use
83 |
84 | CAVEATS:
85 |
86 | - This editor is only meant to edit a single file at a time
87 | - Because of some limitations, in order to use this tool you must follow this guideline...
88 | - Directories will be recognized by their lack of an extension
89 | - Editable files are recognized by their use of an extension
90 | - Although it should work with any device that AMPY works with, it has only been tested with...
91 | - Wemos D1 Mini
92 | - Witty Cloud Board
93 | - Generic NodeMCU Board.
94 | - (Primarily ESP8266 Boards)
95 | - This is mainly for text files (binary files will upload to the device but will not download correctly)
96 | - Switching between the REPL and the editor (and back) is a little rough... especially with the limited built-in serial terminal.
97 | - You may have to "Refresh" or try again to get a feature to work.
98 | - Sometimes the software will pause until the device is momentarily unplugged
99 | - This is highly dependent on the type of application that is running
100 | - It is recommended you use an external application (such as putty or TeraTerm) for the REPL
101 |
102 | ROADMAP:
103 |
104 | - Support multiple files editing at one time
105 | - Split window functionality for file compares
106 | - Provide proper editing functions
107 | - Simple edit commands
108 | - Simple find
109 | - Python formatting cleanup
110 | - Highlighting support for other text file types (html, xml, etc,,,)
111 | - Replace AMPY with integral communication routines to the ESP8266
112 | - Remove directory naming limitation
113 | - Proper options selection window.
--------------------------------------------------------------------------------
/afm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joewez/AmpyFileManager/33009c257e7a40af27e72af16b960b721b13d39a/afm.jpg
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
--------------------------------------------------------------------------------