├── Arduino.PLC
├── Arduino.PLC.csproj
├── Arduino.PLC.sln
├── Arduino.PLC.suo
├── ClosingIcon.ico
├── Common
│ ├── GlobalVariables.cs
│ ├── SPL.Helper.cs
│ ├── SPL.Utils.cs
│ └── SPLCommon.cs
├── EditorForm.Designer.cs
├── EditorForm.cs
├── EditorForm.resx
├── GUI
│ ├── CommandEditorClass.cs
│ ├── GUICommands.cs
│ ├── GUICommon.cs
│ ├── GUIUtils.cs
│ └── PositionGrid.cs
├── HelloApps.ico
├── HelloApps_Blue.ico
├── HelloApps_Logo_4.png
├── HelloApps_Violet.ico
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ ├── Add.png
│ ├── BooleanOp_Equal.png
│ ├── BooleanOp_Inter.png
│ ├── BooleanOp_Minus.png
│ ├── BooleanOp_Plus.png
│ ├── CheckBox.png
│ ├── EmptyBox.png
│ ├── EtcBox.png
│ ├── Expand.png
│ ├── Remove.png
│ ├── Shrink.png
│ ├── splg_icon1.png
│ ├── splg_icon2.png
│ ├── splg_icon3.png
│ ├── splg_icon4.png
│ ├── splg_icon5.png
│ ├── splg_icon6.png
│ ├── splg_icon7.png
│ └── splg_icon8.png
├── SPLConsole.Designer.cs
├── SPLConsole.cs
├── SPLConsole.resx
├── SPLEditor.cs
├── SPLHelper.cs
├── ScriptEditorMenu.txt
├── ScriptEditorMenu_ActionCommand.txt
├── ScriptEditorMenu_Environment.txt
├── SketchViewForm.Designer.cs
├── SketchViewForm.cs
├── SketchViewForm.resx
├── Sketch_Part1.txt
├── Sketch_Part2.txt
├── app.config
└── bin
│ ├── Debug
│ ├── SPL.Duino.PLC.exe.config
│ ├── SPL.Duino.PLC.vshost.exe.config
│ └── SPL.Duino.PLC.vshost.exe.manifest
│ └── Release
│ ├── Arduino.PLC.exe
│ ├── Arduino.PLC.exe.config
│ ├── Arduino.PLC.pdb
│ ├── Arduino.PLC.vshost.exe
│ ├── Arduino.PLC.vshost.exe.config
│ ├── Arduino.PLC.vshost.exe.manifest
│ ├── SPL.Duino.PLC.vshost.exe.config
│ ├── SPL.Duino.PLC.vshost.exe.manifest
│ └── stdole.dll
├── Images
└── arduino_plc1.png
├── LICENSE
├── README.md
├── Samples
├── Example01.txt
├── 기능시험_01.txt
├── 기능시험_02.txt
├── 기능시험_03.txt
├── 기능시험_04.txt
├── 기능시험_05.txt
├── 기능시험_06.txt
└── 기능시험_07.txt
└── Simulation
├── Images
├── README.md
├── bg_tile.png
├── button_yellow_off.png
├── button_yellow_on.png
├── distance_inactive.png
├── fan_off.png
├── fan_on.png
├── light_off.png
├── light_on_blue.png
├── light_on_green.png
├── light_on_red.png
├── sensor_off.png
├── sensor_on.png
├── solenoid_off.png
├── solenoid_on.png
├── switch_off.png
└── switch_on.png
├── ProcessingScript
└── README.md
/Arduino.PLC/Arduino.PLC.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.21022
7 | 2.0
8 | {7214A928-E3C9-4CF4-BF0A-8600DA89C80C}
9 | WinExe
10 | Properties
11 | HelloApps
12 | Arduino.PLC
13 | v2.0
14 | 512
15 | HelloApps_Violet.ico
16 |
17 |
18 |
19 |
20 | 3.5
21 |
22 |
23 | true
24 | full
25 | false
26 | C:\Users\yjoonkim\Microsoft Robotics Dev Studio 2008 Express\bin\
27 | DEBUG;TRACE
28 | prompt
29 | 4
30 |
31 |
32 | pdbonly
33 | true
34 | ..\Arduino.PLC.Output\
35 | TRACE
36 | prompt
37 | 4
38 | true
39 | x86
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | Form
59 |
60 |
61 | EditorForm.cs
62 |
63 |
64 | Component
65 |
66 |
67 |
68 |
69 |
70 | Component
71 |
72 |
73 |
74 |
75 | EditorForm.cs
76 | Designer
77 |
78 |
79 | ResXFileCodeGenerator
80 | Resources.Designer.cs
81 | Designer
82 |
83 |
84 | True
85 | Resources.resx
86 | True
87 |
88 |
89 |
90 | SettingsSingleFileGenerator
91 | Settings.Designer.cs
92 |
93 |
94 | True
95 | Settings.settings
96 | True
97 |
98 |
99 | Form
100 |
101 |
102 | SketchViewForm.cs
103 |
104 |
105 | Form
106 |
107 |
108 | SPLConsole.cs
109 |
110 |
111 | Component
112 |
113 |
114 |
115 |
116 |
117 | False
118 | .NET Framework 3.5 SP1 Client Profile
119 | false
120 |
121 |
122 | False
123 | .NET Framework 2.0 %28x86%29
124 | true
125 |
126 |
127 | False
128 | .NET Framework 3.0 %28x86%29
129 | false
130 |
131 |
132 | False
133 | .NET Framework 3.5
134 | false
135 |
136 |
137 | False
138 | .NET Framework 3.5 SP1
139 | false
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 | SketchViewForm.cs
149 |
150 |
151 |
152 |
153 | SPLConsole.cs
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 | {00020430-0000-0000-C000-000000000046}
187 | 2
188 | 0
189 | 0
190 | primary
191 | False
192 | True
193 |
194 |
195 |
196 |
197 |
204 |
--------------------------------------------------------------------------------
/Arduino.PLC/Arduino.PLC.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arduino.PLC", "Arduino.PLC.csproj", "{7214A928-E3C9-4CF4-BF0A-8600DA89C80C}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {7214A928-E3C9-4CF4-BF0A-8600DA89C80C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {7214A928-E3C9-4CF4-BF0A-8600DA89C80C}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {7214A928-E3C9-4CF4-BF0A-8600DA89C80C}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {7214A928-E3C9-4CF4-BF0A-8600DA89C80C}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/Arduino.PLC/Arduino.PLC.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Arduino.PLC.suo
--------------------------------------------------------------------------------
/Arduino.PLC/ClosingIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/ClosingIcon.ico
--------------------------------------------------------------------------------
/Arduino.PLC/Common/GlobalVariables.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | class GlobalVariables
6 | {
7 | public static string PLCType = "LSIS";
8 |
9 | public static bool MONITORING_MODE = false;
10 | public static Dictionary GLOVAL_VARIABlE_LIST = new Dictionary();
11 | }
12 |
--------------------------------------------------------------------------------
/Arduino.PLC/Common/SPL.Helper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace HelloApps.Common
7 | {
8 | public class ParsingHelper
9 | {
10 | public static ArrayList GetStringList(string inputStr)
11 | {
12 | string[] arr;
13 | arr = inputStr.Split(new Char[] { ' ', ',', '\t' }, 200);
14 |
15 | ArrayList newArr = new ArrayList();
16 |
17 | for (int i = 0; i < arr.Length; i++)
18 | {
19 | if (arr[i] != string.Empty)
20 | {
21 | newArr.Add(arr[i]);
22 | }
23 | }
24 |
25 |
26 | return newArr;
27 | }
28 |
29 |
30 | public static string GetFirstToken(string line)
31 | {
32 | if (line == string.Empty)
33 | return string.Empty; ;
34 |
35 |
36 | string firstToken = string.Empty;
37 |
38 | ArrayList tokenList = GetStringList(line);
39 |
40 | if (tokenList.Count > 0)
41 | firstToken = tokenList[0].ToString();
42 |
43 | if (firstToken.IndexOf("=") >= 0)
44 | {
45 | int eqInd = firstToken.IndexOf("=");
46 |
47 | if (eqInd == 0)
48 | firstToken = string.Empty;
49 | else
50 | firstToken = firstToken.Substring(0, eqInd);
51 | }
52 |
53 | if (firstToken.IndexOf("(") >= 0)
54 | {
55 | int eqInd = firstToken.IndexOf("(");
56 |
57 | if (eqInd == 0)
58 | firstToken = string.Empty;
59 | else
60 | firstToken = firstToken.Substring(0, eqInd);
61 | }
62 |
63 | if (firstToken.IndexOf(":") >= 0)
64 | {
65 | int eqInd = firstToken.IndexOf(":");
66 |
67 | if (eqInd == 0)
68 | firstToken = string.Empty;
69 | else
70 | firstToken = firstToken.Substring(0, eqInd);
71 | }
72 |
73 | if (firstToken.IndexOf("+") >= 0)
74 | {
75 | int eqInd = firstToken.IndexOf("+");
76 |
77 | if (eqInd == 0)
78 | firstToken = string.Empty;
79 | else
80 | firstToken = firstToken.Substring(0, eqInd);
81 | }
82 |
83 | if (firstToken.IndexOf("-") >= 0)
84 | {
85 | int eqInd = firstToken.IndexOf("-");
86 |
87 | if (eqInd == 0)
88 | firstToken = string.Empty;
89 | else
90 | firstToken = firstToken.Substring(0, eqInd);
91 | }
92 |
93 | if (firstToken.IndexOf("{") == 0)
94 | firstToken = "{";
95 | else if (firstToken.IndexOf("}") == 0)
96 | firstToken = "}";
97 | else
98 | {
99 | if (firstToken.IndexOf("{") >= 0)
100 | {
101 | int eqInd = firstToken.IndexOf("{");
102 | firstToken = firstToken.Substring(0, eqInd);
103 | }
104 | }
105 |
106 | return firstToken;
107 | }
108 | }
109 |
110 | }
111 |
112 |
113 |
--------------------------------------------------------------------------------
/Arduino.PLC/Common/SPL.Utils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using Microsoft.Win32;
6 |
7 | namespace HelloApps.Common
8 | {
9 |
10 | public class Util
11 | {
12 |
13 | public static string ReplaceSlashString(string src)
14 | {
15 | char[] arr = src.ToCharArray();
16 |
17 | int openInd = src.IndexOf('"', 0);
18 | int closeInd = -1;
19 |
20 | while (openInd >= 0)
21 | {
22 | closeInd = src.IndexOf('"', openInd + 1);
23 |
24 | if (closeInd >= 0)
25 | {
26 | for (int i = openInd; i <= closeInd; i++)
27 | {
28 | if (arr[i] == '/')
29 | arr[i] = '|';
30 | }
31 |
32 | openInd = src.IndexOf('"', closeInd + 1);
33 | }
34 | else
35 | openInd = -1;
36 | }
37 |
38 | return new string(arr).Trim();
39 | }
40 |
41 | public static string RestoreSlashString(string str)
42 | {
43 | string res = str.Replace('|', '/').Trim();
44 |
45 | if (res.StartsWith("\""))
46 | res = res.Substring(1, res.Length - 1);
47 |
48 | if (res.EndsWith("\""))
49 | res = res.Substring(0, res.Length - 1);
50 |
51 | return res;
52 | }
53 |
54 |
55 | public static string RestoreSingleQuatString(string str)
56 | {
57 | if (str == string.Empty)
58 | return string.Empty;
59 |
60 | string res = string.Empty;
61 |
62 | for (int i = 0; i < str.Length; i++)
63 | {
64 | if (str[i] == (char)0x02)
65 | res += '\'';
66 | else if (str[i] == (char)0x03)
67 | res += '<';
68 | else if (str[i] == (char)0x04)
69 | res += '>';
70 | else
71 | res += str[i];
72 | }
73 |
74 | return res;
75 | }
76 |
77 |
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Arduino.PLC/Common/SPLCommon.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace HelloApps.Common
6 | {
7 | public class SPLCommon
8 | {
9 | public enum SPLEngineLaunchMode
10 | {
11 | Default = 0, GUIOpen = 1, AutoExecute = 2
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Arduino.PLC/EditorForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace HelloApps
2 | {
3 | partial class MainForm
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(MainForm));
33 | this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
34 | this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
35 | this.panel1 = new System.Windows.Forms.Panel();
36 | this.button7 = new System.Windows.Forms.Button();
37 | this.button6 = new System.Windows.Forms.Button();
38 | this.label9 = new System.Windows.Forms.Label();
39 | this.label8 = new System.Windows.Forms.Label();
40 | this.comboBox3 = new System.Windows.Forms.ComboBox();
41 | this.comboBox2 = new System.Windows.Forms.ComboBox();
42 | this.comboBox1 = new System.Windows.Forms.ComboBox();
43 | this.label7 = new System.Windows.Forms.Label();
44 | this.button5 = new System.Windows.Forms.Button();
45 | this.button4 = new System.Windows.Forms.Button();
46 | this.button3 = new System.Windows.Forms.Button();
47 | this.button2 = new System.Windows.Forms.Button();
48 | this.button1 = new System.Windows.Forms.Button();
49 | this.panel4 = new System.Windows.Forms.Panel();
50 | this.panel9 = new System.Windows.Forms.Panel();
51 | this.label_status = new System.Windows.Forms.Label();
52 | this.panel8 = new System.Windows.Forms.Panel();
53 | this.label10 = new System.Windows.Forms.Label();
54 | this.label_line_num = new System.Windows.Forms.Label();
55 | this.panel2 = new System.Windows.Forms.Panel();
56 | this.tabControl2 = new System.Windows.Forms.TabControl();
57 | this.tabPage4 = new System.Windows.Forms.TabPage();
58 | this.listView4 = new System.Windows.Forms.ListView();
59 | this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
60 | this.columnHeader11 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
61 | this.columnHeader12 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
62 | this.splitter2 = new System.Windows.Forms.Splitter();
63 | this.tabControl1 = new System.Windows.Forms.TabControl();
64 | this.imageList1 = new System.Windows.Forms.ImageList(this.components);
65 | this.splitter1 = new System.Windows.Forms.Splitter();
66 | this.panel3 = new System.Windows.Forms.Panel();
67 | this.customTabControl1 = new HelloApps.CustomTabControl();
68 | this.splitter3 = new System.Windows.Forms.Splitter();
69 | this.panel10 = new System.Windows.Forms.Panel();
70 | this.tabControl3 = new System.Windows.Forms.TabControl();
71 | this.tabPage5 = new System.Windows.Forms.TabPage();
72 | this.panel5 = new System.Windows.Forms.Panel();
73 | this.button8 = new System.Windows.Forms.Button();
74 | this.richTextBox1 = new System.Windows.Forms.RichTextBox();
75 | this.label6 = new System.Windows.Forms.Label();
76 | this.textBox3 = new System.Windows.Forms.TextBox();
77 | this.label5 = new System.Windows.Forms.Label();
78 | this.radioButton2 = new System.Windows.Forms.RadioButton();
79 | this.radioButton1 = new System.Windows.Forms.RadioButton();
80 | this.label4 = new System.Windows.Forms.Label();
81 | this.textBox2 = new System.Windows.Forms.TextBox();
82 | this.label3 = new System.Windows.Forms.Label();
83 | this.textBox1 = new System.Windows.Forms.TextBox();
84 | this.label2 = new System.Windows.Forms.Label();
85 | this.listBox1 = new System.Windows.Forms.ListBox();
86 | this.label1 = new System.Windows.Forms.Label();
87 | this.tabPage1 = new System.Windows.Forms.TabPage();
88 | this.panel6 = new System.Windows.Forms.Panel();
89 | this.button11 = new System.Windows.Forms.Button();
90 | this.richTextBox2 = new System.Windows.Forms.RichTextBox();
91 | this.label11 = new System.Windows.Forms.Label();
92 | this.tabPage2 = new System.Windows.Forms.TabPage();
93 | this.listBox2 = new System.Windows.Forms.ListBox();
94 | this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
95 | this.timer_form_load = new System.Windows.Forms.Timer(this.components);
96 | this.timer_auto_script = new System.Windows.Forms.Timer(this.components);
97 | this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
98 | this.라인추가ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
99 | this.라인삭제ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
100 | this.delay1000ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
101 | this.digitalWrite13HIGHToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
102 | this.digitalWrite13LOWToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
103 | this.analogRead0ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
104 | this.printLine123ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
105 | this.tone210001000ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
106 | this.procedureSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
107 | this.timer_util = new System.Windows.Forms.Timer(this.components);
108 | this.timer_monitoring = new System.Windows.Forms.Timer(this.components);
109 | this.panel1.SuspendLayout();
110 | this.panel4.SuspendLayout();
111 | this.panel9.SuspendLayout();
112 | this.panel8.SuspendLayout();
113 | this.panel2.SuspendLayout();
114 | this.tabControl2.SuspendLayout();
115 | this.tabPage4.SuspendLayout();
116 | this.panel3.SuspendLayout();
117 | this.panel10.SuspendLayout();
118 | this.tabControl3.SuspendLayout();
119 | this.tabPage5.SuspendLayout();
120 | this.panel5.SuspendLayout();
121 | this.tabPage1.SuspendLayout();
122 | this.panel6.SuspendLayout();
123 | this.tabPage2.SuspendLayout();
124 | this.contextMenuStrip2.SuspendLayout();
125 | this.SuspendLayout();
126 | //
127 | // panel1
128 | //
129 | this.panel1.Controls.Add(this.button7);
130 | this.panel1.Controls.Add(this.button6);
131 | this.panel1.Controls.Add(this.label9);
132 | this.panel1.Controls.Add(this.label8);
133 | this.panel1.Controls.Add(this.comboBox3);
134 | this.panel1.Controls.Add(this.comboBox2);
135 | this.panel1.Controls.Add(this.comboBox1);
136 | this.panel1.Controls.Add(this.label7);
137 | this.panel1.Controls.Add(this.button5);
138 | this.panel1.Controls.Add(this.button4);
139 | this.panel1.Controls.Add(this.button3);
140 | this.panel1.Controls.Add(this.button2);
141 | this.panel1.Controls.Add(this.button1);
142 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
143 | this.panel1.Location = new System.Drawing.Point(0, 0);
144 | this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
145 | this.panel1.Name = "panel1";
146 | this.panel1.Size = new System.Drawing.Size(1344, 121);
147 | this.panel1.TabIndex = 0;
148 | //
149 | // button7
150 | //
151 | this.button7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
152 | this.button7.Font = new System.Drawing.Font("Gulim", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
153 | this.button7.Location = new System.Drawing.Point(598, 20);
154 | this.button7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
155 | this.button7.Name = "button7";
156 | this.button7.Size = new System.Drawing.Size(110, 79);
157 | this.button7.TabIndex = 12;
158 | this.button7.Text = "Run";
159 | this.button7.UseVisualStyleBackColor = false;
160 | this.button7.Click += new System.EventHandler(this.button7_Click);
161 | //
162 | // button6
163 | //
164 | this.button6.Location = new System.Drawing.Point(983, 22);
165 | this.button6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
166 | this.button6.Name = "button6";
167 | this.button6.Size = new System.Drawing.Size(89, 79);
168 | this.button6.TabIndex = 11;
169 | this.button6.Text = "Close";
170 | this.button6.UseVisualStyleBackColor = true;
171 | this.button6.Click += new System.EventHandler(this.button6_Click);
172 | //
173 | // label9
174 | //
175 | this.label9.AutoSize = true;
176 | this.label9.Location = new System.Drawing.Point(852, 78);
177 | this.label9.Name = "label9";
178 | this.label9.Size = new System.Drawing.Size(65, 15);
179 | this.label9.TabIndex = 10;
180 | this.label9.Text = "Baudrate";
181 | //
182 | // label8
183 | //
184 | this.label8.AutoSize = true;
185 | this.label8.Location = new System.Drawing.Point(852, 49);
186 | this.label8.Name = "label8";
187 | this.label8.Size = new System.Drawing.Size(42, 15);
188 | this.label8.TabIndex = 9;
189 | this.label8.Text = "Ports";
190 | //
191 | // comboBox3
192 | //
193 | this.comboBox3.FormattingEnabled = true;
194 | this.comboBox3.Location = new System.Drawing.Point(725, 76);
195 | this.comboBox3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
196 | this.comboBox3.Name = "comboBox3";
197 | this.comboBox3.Size = new System.Drawing.Size(121, 23);
198 | this.comboBox3.TabIndex = 8;
199 | //
200 | // comboBox2
201 | //
202 | this.comboBox2.FormattingEnabled = true;
203 | this.comboBox2.Location = new System.Drawing.Point(725, 47);
204 | this.comboBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
205 | this.comboBox2.Name = "comboBox2";
206 | this.comboBox2.Size = new System.Drawing.Size(121, 23);
207 | this.comboBox2.TabIndex = 7;
208 | this.comboBox2.Click += new System.EventHandler(this.comboBox2_Click);
209 | //
210 | // comboBox1
211 | //
212 | this.comboBox1.FormattingEnabled = true;
213 | this.comboBox1.Items.AddRange(new object[] {
214 | "LSIS",
215 | "Mitsubishi",
216 | "Siemens"});
217 | this.comboBox1.Location = new System.Drawing.Point(725, 18);
218 | this.comboBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
219 | this.comboBox1.Name = "comboBox1";
220 | this.comboBox1.Size = new System.Drawing.Size(121, 23);
221 | this.comboBox1.TabIndex = 6;
222 | this.comboBox1.Text = "LSIS";
223 | this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
224 | //
225 | // label7
226 | //
227 | this.label7.AutoSize = true;
228 | this.label7.Location = new System.Drawing.Point(852, 22);
229 | this.label7.Name = "label7";
230 | this.label7.Size = new System.Drawing.Size(72, 15);
231 | this.label7.TabIndex = 5;
232 | this.label7.Text = "PLC Type";
233 | //
234 | // button5
235 | //
236 | this.button5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
237 | this.button5.Location = new System.Drawing.Point(482, 20);
238 | this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
239 | this.button5.Name = "button5";
240 | this.button5.Size = new System.Drawing.Size(110, 79);
241 | this.button5.TabIndex = 4;
242 | this.button5.Text = "Start Monitoring";
243 | this.button5.UseVisualStyleBackColor = false;
244 | this.button5.Click += new System.EventHandler(this.button5_Click);
245 | //
246 | // button4
247 | //
248 | this.button4.Location = new System.Drawing.Point(366, 20);
249 | this.button4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
250 | this.button4.Name = "button4";
251 | this.button4.Size = new System.Drawing.Size(110, 79);
252 | this.button4.TabIndex = 3;
253 | this.button4.Text = "SaveAs";
254 | this.button4.UseVisualStyleBackColor = true;
255 | this.button4.Click += new System.EventHandler(this.button4_Click_1);
256 | //
257 | // button3
258 | //
259 | this.button3.Location = new System.Drawing.Point(250, 20);
260 | this.button3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
261 | this.button3.Name = "button3";
262 | this.button3.Size = new System.Drawing.Size(110, 79);
263 | this.button3.TabIndex = 2;
264 | this.button3.Text = "Save";
265 | this.button3.UseVisualStyleBackColor = true;
266 | this.button3.Click += new System.EventHandler(this.button3_Click);
267 | //
268 | // button2
269 | //
270 | this.button2.Location = new System.Drawing.Point(134, 20);
271 | this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
272 | this.button2.Name = "button2";
273 | this.button2.Size = new System.Drawing.Size(110, 79);
274 | this.button2.TabIndex = 1;
275 | this.button2.Text = "Open";
276 | this.button2.UseVisualStyleBackColor = true;
277 | this.button2.Click += new System.EventHandler(this.button2_Click);
278 | //
279 | // button1
280 | //
281 | this.button1.Location = new System.Drawing.Point(18, 20);
282 | this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
283 | this.button1.Name = "button1";
284 | this.button1.Size = new System.Drawing.Size(110, 79);
285 | this.button1.TabIndex = 0;
286 | this.button1.Text = "New File";
287 | this.button1.UseVisualStyleBackColor = true;
288 | this.button1.Click += new System.EventHandler(this.button1_Click_1);
289 | //
290 | // panel4
291 | //
292 | this.panel4.Controls.Add(this.panel9);
293 | this.panel4.Controls.Add(this.panel8);
294 | this.panel4.Dock = System.Windows.Forms.DockStyle.Bottom;
295 | this.panel4.Location = new System.Drawing.Point(0, 781);
296 | this.panel4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
297 | this.panel4.Name = "panel4";
298 | this.panel4.Size = new System.Drawing.Size(1344, 30);
299 | this.panel4.TabIndex = 2;
300 | //
301 | // panel9
302 | //
303 | this.panel9.Controls.Add(this.label_status);
304 | this.panel9.Dock = System.Windows.Forms.DockStyle.Fill;
305 | this.panel9.Location = new System.Drawing.Point(0, 0);
306 | this.panel9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
307 | this.panel9.Name = "panel9";
308 | this.panel9.Size = new System.Drawing.Size(818, 30);
309 | this.panel9.TabIndex = 45;
310 | //
311 | // label_status
312 | //
313 | this.label_status.AutoSize = true;
314 | this.label_status.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
315 | this.label_status.Location = new System.Drawing.Point(15, 8);
316 | this.label_status.Name = "label_status";
317 | this.label_status.Size = new System.Drawing.Size(148, 14);
318 | this.label_status.TabIndex = 43;
319 | this.label_status.Text = "Arduino PLC Programming";
320 | //
321 | // panel8
322 | //
323 | this.panel8.Controls.Add(this.label10);
324 | this.panel8.Controls.Add(this.label_line_num);
325 | this.panel8.Dock = System.Windows.Forms.DockStyle.Right;
326 | this.panel8.Location = new System.Drawing.Point(818, 0);
327 | this.panel8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
328 | this.panel8.Name = "panel8";
329 | this.panel8.Size = new System.Drawing.Size(526, 30);
330 | this.panel8.TabIndex = 44;
331 | //
332 | // label10
333 | //
334 | this.label10.AutoSize = true;
335 | this.label10.Location = new System.Drawing.Point(162, 2);
336 | this.label10.Name = "label10";
337 | this.label10.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
338 | this.label10.Size = new System.Drawing.Size(352, 23);
339 | this.label10.TabIndex = 44;
340 | this.label10.Text = "Copyright © HelloApps, 2019, All Rights Reserved. ";
341 | //
342 | // label_line_num
343 | //
344 | this.label_line_num.AutoSize = true;
345 | this.label_line_num.Location = new System.Drawing.Point(13, 8);
346 | this.label_line_num.Name = "label_line_num";
347 | this.label_line_num.Size = new System.Drawing.Size(97, 15);
348 | this.label_line_num.TabIndex = 0;
349 | this.label_line_num.Text = "Line 0, Col 0 ";
350 | //
351 | // panel2
352 | //
353 | this.panel2.Controls.Add(this.tabControl2);
354 | this.panel2.Controls.Add(this.splitter2);
355 | this.panel2.Controls.Add(this.tabControl1);
356 | this.panel2.Dock = System.Windows.Forms.DockStyle.Left;
357 | this.panel2.Location = new System.Drawing.Point(0, 121);
358 | this.panel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
359 | this.panel2.Name = "panel2";
360 | this.panel2.Size = new System.Drawing.Size(296, 660);
361 | this.panel2.TabIndex = 3;
362 | //
363 | // tabControl2
364 | //
365 | this.tabControl2.Controls.Add(this.tabPage4);
366 | this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
367 | this.tabControl2.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
368 | this.tabControl2.ImeMode = System.Windows.Forms.ImeMode.Alpha;
369 | this.tabControl2.Location = new System.Drawing.Point(0, 0);
370 | this.tabControl2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
371 | this.tabControl2.Name = "tabControl2";
372 | this.tabControl2.SelectedIndex = 0;
373 | this.tabControl2.Size = new System.Drawing.Size(296, 217);
374 | this.tabControl2.TabIndex = 3;
375 | //
376 | // tabPage4
377 | //
378 | this.tabPage4.Controls.Add(this.listView4);
379 | this.tabPage4.Location = new System.Drawing.Point(4, 23);
380 | this.tabPage4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
381 | this.tabPage4.Name = "tabPage4";
382 | this.tabPage4.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
383 | this.tabPage4.Size = new System.Drawing.Size(288, 190);
384 | this.tabPage4.TabIndex = 3;
385 | this.tabPage4.Text = "Rescent Files";
386 | this.tabPage4.UseVisualStyleBackColor = true;
387 | //
388 | // listView4
389 | //
390 | this.listView4.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
391 | this.columnHeader10,
392 | this.columnHeader11,
393 | this.columnHeader12});
394 | this.listView4.Dock = System.Windows.Forms.DockStyle.Fill;
395 | this.listView4.FullRowSelect = true;
396 | this.listView4.Location = new System.Drawing.Point(3, 2);
397 | this.listView4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
398 | this.listView4.Name = "listView4";
399 | this.listView4.Size = new System.Drawing.Size(282, 186);
400 | this.listView4.TabIndex = 0;
401 | this.listView4.UseCompatibleStateImageBehavior = false;
402 | this.listView4.View = System.Windows.Forms.View.Details;
403 | this.listView4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listView4_MouseClick);
404 | this.listView4.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listView4_MouseDoubleClick);
405 | //
406 | // columnHeader10
407 | //
408 | this.columnHeader10.Text = "File Name";
409 | this.columnHeader10.Width = 250;
410 | //
411 | // columnHeader11
412 | //
413 | this.columnHeader11.Text = "DateTime";
414 | this.columnHeader11.Width = 180;
415 | //
416 | // columnHeader12
417 | //
418 | this.columnHeader12.Text = "Path";
419 | this.columnHeader12.Width = 200;
420 | //
421 | // splitter2
422 | //
423 | this.splitter2.Dock = System.Windows.Forms.DockStyle.Bottom;
424 | this.splitter2.Location = new System.Drawing.Point(0, 217);
425 | this.splitter2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
426 | this.splitter2.Name = "splitter2";
427 | this.splitter2.Size = new System.Drawing.Size(296, 2);
428 | this.splitter2.TabIndex = 2;
429 | this.splitter2.TabStop = false;
430 | //
431 | // tabControl1
432 | //
433 | this.tabControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
434 | this.tabControl1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
435 | this.tabControl1.ImeMode = System.Windows.Forms.ImeMode.Alpha;
436 | this.tabControl1.Location = new System.Drawing.Point(0, 219);
437 | this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
438 | this.tabControl1.Name = "tabControl1";
439 | this.tabControl1.SelectedIndex = 0;
440 | this.tabControl1.Size = new System.Drawing.Size(296, 441);
441 | this.tabControl1.TabIndex = 1;
442 | //
443 | // imageList1
444 | //
445 | this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
446 | this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
447 | this.imageList1.Images.SetKeyName(0, "ClosingIcon.ico");
448 | this.imageList1.Images.SetKeyName(1, "HelloApps_Violet.ico");
449 | this.imageList1.Images.SetKeyName(2, "icon_file.bmp");
450 | this.imageList1.Images.SetKeyName(3, "icon_folder.bmp");
451 | this.imageList1.Images.SetKeyName(4, "icon_folder_up.bmp");
452 | this.imageList1.Images.SetKeyName(5, "icon_script.bmp");
453 | //
454 | // splitter1
455 | //
456 | this.splitter1.Location = new System.Drawing.Point(296, 121);
457 | this.splitter1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
458 | this.splitter1.Name = "splitter1";
459 | this.splitter1.Size = new System.Drawing.Size(3, 660);
460 | this.splitter1.TabIndex = 4;
461 | this.splitter1.TabStop = false;
462 | //
463 | // panel3
464 | //
465 | this.panel3.Controls.Add(this.customTabControl1);
466 | this.panel3.Controls.Add(this.splitter3);
467 | this.panel3.Controls.Add(this.panel10);
468 | this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
469 | this.panel3.Location = new System.Drawing.Point(299, 121);
470 | this.panel3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
471 | this.panel3.Name = "panel3";
472 | this.panel3.Size = new System.Drawing.Size(1045, 660);
473 | this.panel3.TabIndex = 5;
474 | //
475 | // customTabControl1
476 | //
477 | this.customTabControl1.AllowDrop = true;
478 | this.customTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
479 | this.customTabControl1.Location = new System.Drawing.Point(0, 0);
480 | this.customTabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
481 | this.customTabControl1.Name = "customTabControl1";
482 | this.customTabControl1.SelectedIndex = 0;
483 | this.customTabControl1.Size = new System.Drawing.Size(733, 660);
484 | this.customTabControl1.TabIndex = 3;
485 | this.customTabControl1.DragDrop += new System.Windows.Forms.DragEventHandler(this.customTabControl1_DragDrop);
486 | this.customTabControl1.DragEnter += new System.Windows.Forms.DragEventHandler(this.customTabControl1_DragEnter);
487 | //
488 | // splitter3
489 | //
490 | this.splitter3.Dock = System.Windows.Forms.DockStyle.Right;
491 | this.splitter3.Location = new System.Drawing.Point(733, 0);
492 | this.splitter3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
493 | this.splitter3.Name = "splitter3";
494 | this.splitter3.Size = new System.Drawing.Size(5, 660);
495 | this.splitter3.TabIndex = 5;
496 | this.splitter3.TabStop = false;
497 | //
498 | // panel10
499 | //
500 | this.panel10.Controls.Add(this.tabControl3);
501 | this.panel10.Dock = System.Windows.Forms.DockStyle.Right;
502 | this.panel10.Location = new System.Drawing.Point(738, 0);
503 | this.panel10.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
504 | this.panel10.Name = "panel10";
505 | this.panel10.Size = new System.Drawing.Size(307, 660);
506 | this.panel10.TabIndex = 7;
507 | //
508 | // tabControl3
509 | //
510 | this.tabControl3.Controls.Add(this.tabPage5);
511 | this.tabControl3.Controls.Add(this.tabPage1);
512 | this.tabControl3.Controls.Add(this.tabPage2);
513 | this.tabControl3.Dock = System.Windows.Forms.DockStyle.Fill;
514 | this.tabControl3.Location = new System.Drawing.Point(0, 0);
515 | this.tabControl3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
516 | this.tabControl3.Name = "tabControl3";
517 | this.tabControl3.SelectedIndex = 0;
518 | this.tabControl3.Size = new System.Drawing.Size(307, 660);
519 | this.tabControl3.TabIndex = 6;
520 | this.tabControl3.SelectedIndexChanged += new System.EventHandler(this.tabControl3_SelectedIndexChanged);
521 | //
522 | // tabPage5
523 | //
524 | this.tabPage5.Controls.Add(this.panel5);
525 | this.tabPage5.Location = new System.Drawing.Point(4, 25);
526 | this.tabPage5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
527 | this.tabPage5.Name = "tabPage5";
528 | this.tabPage5.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
529 | this.tabPage5.Size = new System.Drawing.Size(299, 631);
530 | this.tabPage5.TabIndex = 0;
531 | this.tabPage5.Text = "Settings";
532 | this.tabPage5.UseVisualStyleBackColor = true;
533 | //
534 | // panel5
535 | //
536 | this.panel5.Controls.Add(this.button8);
537 | this.panel5.Controls.Add(this.richTextBox1);
538 | this.panel5.Controls.Add(this.label6);
539 | this.panel5.Controls.Add(this.textBox3);
540 | this.panel5.Controls.Add(this.label5);
541 | this.panel5.Controls.Add(this.radioButton2);
542 | this.panel5.Controls.Add(this.radioButton1);
543 | this.panel5.Controls.Add(this.label4);
544 | this.panel5.Controls.Add(this.textBox2);
545 | this.panel5.Controls.Add(this.label3);
546 | this.panel5.Controls.Add(this.textBox1);
547 | this.panel5.Controls.Add(this.label2);
548 | this.panel5.Controls.Add(this.listBox1);
549 | this.panel5.Controls.Add(this.label1);
550 | this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
551 | this.panel5.Location = new System.Drawing.Point(3, 2);
552 | this.panel5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
553 | this.panel5.Name = "panel5";
554 | this.panel5.Size = new System.Drawing.Size(293, 627);
555 | this.panel5.TabIndex = 0;
556 | //
557 | // button8
558 | //
559 | this.button8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
560 | this.button8.Location = new System.Drawing.Point(97, 577);
561 | this.button8.Name = "button8";
562 | this.button8.Size = new System.Drawing.Size(173, 37);
563 | this.button8.TabIndex = 14;
564 | this.button8.Text = "Apply";
565 | this.button8.UseVisualStyleBackColor = true;
566 | this.button8.Click += new System.EventHandler(this.button8_Click);
567 | //
568 | // richTextBox1
569 | //
570 | this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
571 | | System.Windows.Forms.AnchorStyles.Left)
572 | | System.Windows.Forms.AnchorStyles.Right)));
573 | this.richTextBox1.Enabled = false;
574 | this.richTextBox1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
575 | this.richTextBox1.Location = new System.Drawing.Point(22, 444);
576 | this.richTextBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
577 | this.richTextBox1.Name = "richTextBox1";
578 | this.richTextBox1.Size = new System.Drawing.Size(249, 123);
579 | this.richTextBox1.TabIndex = 12;
580 | this.richTextBox1.Text = "";
581 | //
582 | // label6
583 | //
584 | this.label6.AutoSize = true;
585 | this.label6.Enabled = false;
586 | this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
587 | this.label6.Location = new System.Drawing.Point(18, 422);
588 | this.label6.Name = "label6";
589 | this.label6.Size = new System.Drawing.Size(50, 20);
590 | this.label6.TabIndex = 11;
591 | this.label6.Text = "Script";
592 | //
593 | // textBox3
594 | //
595 | this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
596 | | System.Windows.Forms.AnchorStyles.Right)));
597 | this.textBox3.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
598 | this.textBox3.Location = new System.Drawing.Point(104, 381);
599 | this.textBox3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
600 | this.textBox3.Name = "textBox3";
601 | this.textBox3.Size = new System.Drawing.Size(166, 26);
602 | this.textBox3.TabIndex = 10;
603 | //
604 | // label5
605 | //
606 | this.label5.AutoSize = true;
607 | this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
608 | this.label5.Location = new System.Drawing.Point(18, 385);
609 | this.label5.Name = "label5";
610 | this.label5.Size = new System.Drawing.Size(68, 20);
611 | this.label5.TabIndex = 9;
612 | this.label5.Text = "Pin Num";
613 | //
614 | // radioButton2
615 | //
616 | this.radioButton2.AutoSize = true;
617 | this.radioButton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
618 | this.radioButton2.Location = new System.Drawing.Point(148, 340);
619 | this.radioButton2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
620 | this.radioButton2.Name = "radioButton2";
621 | this.radioButton2.Size = new System.Drawing.Size(102, 24);
622 | this.radioButton2.TabIndex = 8;
623 | this.radioButton2.Text = "Run Script";
624 | this.radioButton2.UseVisualStyleBackColor = true;
625 | this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
626 | //
627 | // radioButton1
628 | //
629 | this.radioButton1.AutoSize = true;
630 | this.radioButton1.Checked = true;
631 | this.radioButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
632 | this.radioButton1.Location = new System.Drawing.Point(31, 340);
633 | this.radioButton1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
634 | this.radioButton1.Name = "radioButton1";
635 | this.radioButton1.Size = new System.Drawing.Size(97, 24);
636 | this.radioButton1.TabIndex = 7;
637 | this.radioButton1.TabStop = true;
638 | this.radioButton1.Text = "Digital Pin";
639 | this.radioButton1.UseVisualStyleBackColor = true;
640 | this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
641 | //
642 | // label4
643 | //
644 | this.label4.AutoSize = true;
645 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
646 | this.label4.Location = new System.Drawing.Point(18, 310);
647 | this.label4.Name = "label4";
648 | this.label4.Size = new System.Drawing.Size(113, 20);
649 | this.label4.TabIndex = 6;
650 | this.label4.Text = "Mappting Type";
651 | //
652 | // textBox2
653 | //
654 | this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
655 | | System.Windows.Forms.AnchorStyles.Right)));
656 | this.textBox2.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
657 | this.textBox2.Location = new System.Drawing.Point(104, 258);
658 | this.textBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
659 | this.textBox2.Name = "textBox2";
660 | this.textBox2.Size = new System.Drawing.Size(166, 26);
661 | this.textBox2.TabIndex = 5;
662 | //
663 | // label3
664 | //
665 | this.label3.AutoSize = true;
666 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
667 | this.label3.Location = new System.Drawing.Point(18, 260);
668 | this.label3.Name = "label3";
669 | this.label3.Size = new System.Drawing.Size(46, 20);
670 | this.label3.TabIndex = 4;
671 | this.label3.Text = "Desc";
672 | //
673 | // textBox1
674 | //
675 | this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
676 | | System.Windows.Forms.AnchorStyles.Right)));
677 | this.textBox1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
678 | this.textBox1.Location = new System.Drawing.Point(104, 228);
679 | this.textBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
680 | this.textBox1.Name = "textBox1";
681 | this.textBox1.Size = new System.Drawing.Size(166, 26);
682 | this.textBox1.TabIndex = 3;
683 | //
684 | // label2
685 | //
686 | this.label2.AutoSize = true;
687 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
688 | this.label2.Location = new System.Drawing.Point(18, 228);
689 | this.label2.Name = "label2";
690 | this.label2.Size = new System.Drawing.Size(51, 20);
691 | this.label2.TabIndex = 2;
692 | this.label2.Text = "Name";
693 | //
694 | // listBox1
695 | //
696 | this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
697 | | System.Windows.Forms.AnchorStyles.Right)));
698 | this.listBox1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
699 | this.listBox1.FormattingEnabled = true;
700 | this.listBox1.ItemHeight = 18;
701 | this.listBox1.Location = new System.Drawing.Point(22, 49);
702 | this.listBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
703 | this.listBox1.Name = "listBox1";
704 | this.listBox1.Size = new System.Drawing.Size(249, 130);
705 | this.listBox1.TabIndex = 1;
706 | //
707 | // label1
708 | //
709 | this.label1.AutoSize = true;
710 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
711 | this.label1.Location = new System.Drawing.Point(18, 28);
712 | this.label1.Name = "label1";
713 | this.label1.Size = new System.Drawing.Size(161, 20);
714 | this.label1.TabIndex = 0;
715 | this.label1.Text = "Arduino Mapping Info";
716 | //
717 | // tabPage1
718 | //
719 | this.tabPage1.Controls.Add(this.panel6);
720 | this.tabPage1.Location = new System.Drawing.Point(4, 25);
721 | this.tabPage1.Name = "tabPage1";
722 | this.tabPage1.Size = new System.Drawing.Size(299, 631);
723 | this.tabPage1.TabIndex = 1;
724 | this.tabPage1.Text = "User Sketch";
725 | this.tabPage1.UseVisualStyleBackColor = true;
726 | //
727 | // panel6
728 | //
729 | this.panel6.Controls.Add(this.button11);
730 | this.panel6.Controls.Add(this.richTextBox2);
731 | this.panel6.Controls.Add(this.label11);
732 | this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
733 | this.panel6.Location = new System.Drawing.Point(0, 0);
734 | this.panel6.Name = "panel6";
735 | this.panel6.Size = new System.Drawing.Size(299, 631);
736 | this.panel6.TabIndex = 0;
737 | //
738 | // button11
739 | //
740 | this.button11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
741 | this.button11.Location = new System.Drawing.Point(102, 568);
742 | this.button11.Name = "button11";
743 | this.button11.Size = new System.Drawing.Size(173, 37);
744 | this.button11.TabIndex = 17;
745 | this.button11.Text = "Apply";
746 | this.button11.UseVisualStyleBackColor = true;
747 | //
748 | // richTextBox2
749 | //
750 | this.richTextBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
751 | | System.Windows.Forms.AnchorStyles.Left)
752 | | System.Windows.Forms.AnchorStyles.Right)));
753 | this.richTextBox2.Enabled = false;
754 | this.richTextBox2.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
755 | this.richTextBox2.Location = new System.Drawing.Point(26, 34);
756 | this.richTextBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
757 | this.richTextBox2.Name = "richTextBox2";
758 | this.richTextBox2.Size = new System.Drawing.Size(249, 518);
759 | this.richTextBox2.TabIndex = 16;
760 | this.richTextBox2.Text = "";
761 | //
762 | // label11
763 | //
764 | this.label11.AutoSize = true;
765 | this.label11.Enabled = false;
766 | this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
767 | this.label11.Location = new System.Drawing.Point(22, 12);
768 | this.label11.Name = "label11";
769 | this.label11.Size = new System.Drawing.Size(139, 20);
770 | this.label11.TabIndex = 15;
771 | this.label11.Text = "User Sketch Code";
772 | //
773 | // tabPage2
774 | //
775 | this.tabPage2.Controls.Add(this.listBox2);
776 | this.tabPage2.Location = new System.Drawing.Point(4, 25);
777 | this.tabPage2.Name = "tabPage2";
778 | this.tabPage2.Size = new System.Drawing.Size(299, 631);
779 | this.tabPage2.TabIndex = 2;
780 | this.tabPage2.Text = "Log";
781 | this.tabPage2.UseVisualStyleBackColor = true;
782 | //
783 | // listBox2
784 | //
785 | this.listBox2.Dock = System.Windows.Forms.DockStyle.Fill;
786 | this.listBox2.FormattingEnabled = true;
787 | this.listBox2.ItemHeight = 15;
788 | this.listBox2.Location = new System.Drawing.Point(0, 0);
789 | this.listBox2.Name = "listBox2";
790 | this.listBox2.Size = new System.Drawing.Size(299, 631);
791 | this.listBox2.TabIndex = 0;
792 | //
793 | // timer_form_load
794 | //
795 | this.timer_form_load.Interval = 10;
796 | this.timer_form_load.Tick += new System.EventHandler(this.timer_form_load_Tick);
797 | //
798 | // timer_auto_script
799 | //
800 | this.timer_auto_script.Tick += new System.EventHandler(this.timer_auto_script_Tick);
801 | //
802 | // contextMenuStrip2
803 | //
804 | this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
805 | this.라인추가ToolStripMenuItem,
806 | this.라인삭제ToolStripMenuItem,
807 | this.delay1000ToolStripMenuItem1,
808 | this.digitalWrite13HIGHToolStripMenuItem1,
809 | this.digitalWrite13LOWToolStripMenuItem1,
810 | this.analogRead0ToolStripMenuItem1,
811 | this.printLine123ToolStripMenuItem1,
812 | this.tone210001000ToolStripMenuItem,
813 | this.procedureSetupToolStripMenuItem});
814 | this.contextMenuStrip2.Name = "contextMenuStrip2";
815 | this.contextMenuStrip2.Size = new System.Drawing.Size(196, 202);
816 | //
817 | // 라인추가ToolStripMenuItem
818 | //
819 | this.라인추가ToolStripMenuItem.Name = "라인추가ToolStripMenuItem";
820 | this.라인추가ToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
821 | this.라인추가ToolStripMenuItem.Text = "Insert Line";
822 | //
823 | // 라인삭제ToolStripMenuItem
824 | //
825 | this.라인삭제ToolStripMenuItem.Name = "라인삭제ToolStripMenuItem";
826 | this.라인삭제ToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
827 | this.라인삭제ToolStripMenuItem.Text = "Remove Line";
828 | //
829 | // delay1000ToolStripMenuItem1
830 | //
831 | this.delay1000ToolStripMenuItem1.Name = "delay1000ToolStripMenuItem1";
832 | this.delay1000ToolStripMenuItem1.Size = new System.Drawing.Size(195, 22);
833 | this.delay1000ToolStripMenuItem1.Text = "Delay(1000)";
834 | //
835 | // digitalWrite13HIGHToolStripMenuItem1
836 | //
837 | this.digitalWrite13HIGHToolStripMenuItem1.Name = "digitalWrite13HIGHToolStripMenuItem1";
838 | this.digitalWrite13HIGHToolStripMenuItem1.Size = new System.Drawing.Size(195, 22);
839 | this.digitalWrite13HIGHToolStripMenuItem1.Text = "DigitalWrite(13, HIGH)";
840 | //
841 | // digitalWrite13LOWToolStripMenuItem1
842 | //
843 | this.digitalWrite13LOWToolStripMenuItem1.Name = "digitalWrite13LOWToolStripMenuItem1";
844 | this.digitalWrite13LOWToolStripMenuItem1.Size = new System.Drawing.Size(195, 22);
845 | this.digitalWrite13LOWToolStripMenuItem1.Text = "DigitalWrite(13, LOW)";
846 | //
847 | // analogRead0ToolStripMenuItem1
848 | //
849 | this.analogRead0ToolStripMenuItem1.Name = "analogRead0ToolStripMenuItem1";
850 | this.analogRead0ToolStripMenuItem1.Size = new System.Drawing.Size(195, 22);
851 | this.analogRead0ToolStripMenuItem1.Text = "AnalogRead(0)";
852 | //
853 | // printLine123ToolStripMenuItem1
854 | //
855 | this.printLine123ToolStripMenuItem1.Name = "printLine123ToolStripMenuItem1";
856 | this.printLine123ToolStripMenuItem1.Size = new System.Drawing.Size(195, 22);
857 | this.printLine123ToolStripMenuItem1.Text = "PrintLine(\"123\")";
858 | //
859 | // tone210001000ToolStripMenuItem
860 | //
861 | this.tone210001000ToolStripMenuItem.Name = "tone210001000ToolStripMenuItem";
862 | this.tone210001000ToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
863 | this.tone210001000ToolStripMenuItem.Text = "Tone(2, 1000, 1000)";
864 | //
865 | // procedureSetupToolStripMenuItem
866 | //
867 | this.procedureSetupToolStripMenuItem.Name = "procedureSetupToolStripMenuItem";
868 | this.procedureSetupToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
869 | this.procedureSetupToolStripMenuItem.Text = "void Setup()";
870 | //
871 | // timer_util
872 | //
873 | this.timer_util.Interval = 1000;
874 | this.timer_util.Tick += new System.EventHandler(this.timer_util_Tick);
875 | //
876 | // timer_monitoring
877 | //
878 | this.timer_monitoring.Tick += new System.EventHandler(this.timer_monitoring_Tick);
879 | //
880 | // MainForm
881 | //
882 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
883 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
884 | this.ClientSize = new System.Drawing.Size(1344, 811);
885 | this.Controls.Add(this.panel3);
886 | this.Controls.Add(this.splitter1);
887 | this.Controls.Add(this.panel2);
888 | this.Controls.Add(this.panel4);
889 | this.Controls.Add(this.panel1);
890 | this.Font = new System.Drawing.Font("Gulim", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
891 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
892 | this.ImeMode = System.Windows.Forms.ImeMode.Alpha;
893 | this.KeyPreview = true;
894 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
895 | this.Name = "MainForm";
896 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
897 | this.Text = "Arduino PLC Programming";
898 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
899 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
900 | this.Load += new System.EventHandler(this.Form1_Load);
901 | this.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.Form1_PreviewKeyDown);
902 | this.Resize += new System.EventHandler(this.Form1_Resize);
903 | this.panel1.ResumeLayout(false);
904 | this.panel1.PerformLayout();
905 | this.panel4.ResumeLayout(false);
906 | this.panel9.ResumeLayout(false);
907 | this.panel9.PerformLayout();
908 | this.panel8.ResumeLayout(false);
909 | this.panel8.PerformLayout();
910 | this.panel2.ResumeLayout(false);
911 | this.tabControl2.ResumeLayout(false);
912 | this.tabPage4.ResumeLayout(false);
913 | this.panel3.ResumeLayout(false);
914 | this.panel10.ResumeLayout(false);
915 | this.tabControl3.ResumeLayout(false);
916 | this.tabPage5.ResumeLayout(false);
917 | this.panel5.ResumeLayout(false);
918 | this.panel5.PerformLayout();
919 | this.tabPage1.ResumeLayout(false);
920 | this.panel6.ResumeLayout(false);
921 | this.panel6.PerformLayout();
922 | this.tabPage2.ResumeLayout(false);
923 | this.contextMenuStrip2.ResumeLayout(false);
924 | this.ResumeLayout(false);
925 |
926 | }
927 |
928 | #endregion
929 |
930 | private System.Windows.Forms.OpenFileDialog openFileDialog;
931 | private System.Windows.Forms.SaveFileDialog saveFileDialog;
932 | private System.Windows.Forms.Panel panel1;
933 | private System.Windows.Forms.Panel panel4;
934 | private System.Windows.Forms.Panel panel2;
935 | private System.Windows.Forms.Splitter splitter1;
936 | private System.Windows.Forms.Panel panel3;
937 | private System.Windows.Forms.ImageList imageList1;
938 | private System.Windows.Forms.TabControl tabControl1;
939 | private System.Windows.Forms.TabControl tabControl2;
940 | private System.Windows.Forms.Splitter splitter2;
941 | private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
942 | private System.Windows.Forms.TabPage tabPage4;
943 | private System.Windows.Forms.ListView listView4;
944 | private System.Windows.Forms.ColumnHeader columnHeader10;
945 | private System.Windows.Forms.ColumnHeader columnHeader11;
946 | private System.Windows.Forms.ColumnHeader columnHeader12;
947 | private CustomTabControl customTabControl1;
948 | private System.Windows.Forms.Panel panel8;
949 | private System.Windows.Forms.Label label_line_num;
950 | private System.Windows.Forms.Label label10;
951 | private System.Windows.Forms.Panel panel9;
952 | private System.Windows.Forms.Label label_status;
953 | private System.Windows.Forms.Timer timer_form_load;
954 | private System.Windows.Forms.Timer timer_auto_script;
955 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip2;
956 | private System.Windows.Forms.ToolStripMenuItem 라인추가ToolStripMenuItem;
957 | private System.Windows.Forms.ToolStripMenuItem 라인삭제ToolStripMenuItem;
958 | private System.Windows.Forms.ToolStripMenuItem digitalWrite13HIGHToolStripMenuItem1;
959 | private System.Windows.Forms.ToolStripMenuItem digitalWrite13LOWToolStripMenuItem1;
960 | private System.Windows.Forms.ToolStripMenuItem analogRead0ToolStripMenuItem1;
961 | private System.Windows.Forms.ToolStripMenuItem delay1000ToolStripMenuItem1;
962 | private System.Windows.Forms.ToolStripMenuItem printLine123ToolStripMenuItem1;
963 | private System.Windows.Forms.ToolStripMenuItem tone210001000ToolStripMenuItem;
964 | private System.Windows.Forms.ToolStripMenuItem procedureSetupToolStripMenuItem;
965 | private System.Windows.Forms.Splitter splitter3;
966 | private System.Windows.Forms.TabControl tabControl3;
967 | private System.Windows.Forms.TabPage tabPage5;
968 | private System.Windows.Forms.Panel panel10;
969 | private System.Windows.Forms.Timer timer_util;
970 | private System.Windows.Forms.Panel panel5;
971 | private System.Windows.Forms.ListBox listBox1;
972 | private System.Windows.Forms.Label label1;
973 | private System.Windows.Forms.Label label2;
974 | private System.Windows.Forms.TextBox textBox2;
975 | private System.Windows.Forms.Label label3;
976 | private System.Windows.Forms.TextBox textBox1;
977 | private System.Windows.Forms.Label label4;
978 | private System.Windows.Forms.RadioButton radioButton2;
979 | private System.Windows.Forms.RadioButton radioButton1;
980 | private System.Windows.Forms.RichTextBox richTextBox1;
981 | private System.Windows.Forms.Label label6;
982 | private System.Windows.Forms.TextBox textBox3;
983 | private System.Windows.Forms.Label label5;
984 | private System.Windows.Forms.Button button4;
985 | private System.Windows.Forms.Button button3;
986 | private System.Windows.Forms.Button button2;
987 | private System.Windows.Forms.Button button1;
988 | private System.Windows.Forms.Button button5;
989 | private System.Windows.Forms.Label label9;
990 | private System.Windows.Forms.Label label8;
991 | private System.Windows.Forms.ComboBox comboBox3;
992 | private System.Windows.Forms.ComboBox comboBox2;
993 | private System.Windows.Forms.ComboBox comboBox1;
994 | private System.Windows.Forms.Label label7;
995 | private System.Windows.Forms.Button button6;
996 | private System.Windows.Forms.Button button7;
997 | private System.Windows.Forms.Button button8;
998 | private System.Windows.Forms.TabPage tabPage1;
999 | private System.Windows.Forms.Panel panel6;
1000 | private System.Windows.Forms.Button button11;
1001 | private System.Windows.Forms.RichTextBox richTextBox2;
1002 | private System.Windows.Forms.Label label11;
1003 | private System.Windows.Forms.TabPage tabPage2;
1004 | private System.Windows.Forms.ListBox listBox2;
1005 | private System.Windows.Forms.Timer timer_monitoring;
1006 | }
1007 | }
1008 |
1009 |
--------------------------------------------------------------------------------
/Arduino.PLC/GUI/GUICommands.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Drawing;
6 | using System.Windows.Forms;
7 |
8 | namespace HelloApps.GUI
9 | {
10 | public enum CommandTypes
11 | {
12 | None = 0, Read = 1, Write = 2, Logic = 3, Procedure = 4, Call = 5,
13 | Flush = 6, TargetExpr = 7, Tone = 8, Expr1 = 9, Expr2 = 10,
14 | Expr3 = 11, Print = 12, EmptyLine = 13,
15 | Map = 14, Delay = 15, Millis = 16,
16 | SerialWrite = 17, SetColor = 18, SetAllColor = 19, Expr0 = 20, DriveWrite = 21,
17 | DigitalTempRead = 22, AnalogTempRead = 23, ImportScript = 24, Expr3_XYV = 25, SerialBegin = 26, MotorDrive = 27,
18 | NSBeginWithPin = 28, NSClearWithPin = 29, NSSetColorWithPin = 30, NSShowWithPin = 31, Expr5_XYRGB = 32,
19 | LoRa_SendMessage = 33, LoRa_SendMessageHex = 34, LoRa_GetMessage = 35, LoRa_GetMessageHex = 36, LoRa_Reset = 37, LoRa_PrintTTV = 38, LoRa_StringToHex = 39
20 | }
21 |
22 |
23 | public class GUICommandItem
24 | {
25 | public BlockListType CommandMode = BlockListType.None;
26 | public string CommandName = string.Empty;
27 | public CommandTypes CommandType = CommandTypes.Expr1;
28 |
29 | public string DisplayName = string.Empty;
30 | public string ToolTip = string.Empty;
31 |
32 | public string OptionPosition = "0 0 0";
33 | public string OptionScale = "1 1 1";
34 | public string OptionOrientation = "0 0 0";
35 | public string OptionColor = string.Empty;
36 | public string OptionStartPoint = "0 0 0";
37 | public string OptionEndPoint = "0 0 1";
38 | public string OptionSlices = "36";
39 | public string OptionVerticalSlices = "36";
40 |
41 | public string[] Values = new string[10];
42 |
43 | public bool Checked = true;
44 | public bool VisibleYN = true;
45 | public bool Shrinked = false;
46 |
47 |
48 | public Brush BgColor = new SolidBrush(Color.FromArgb(200, 200, 200));
49 | public Brush ShadowColor = new SolidBrush(Color.FromArgb(170, 170, 170));
50 |
51 | public Brush UnChecked_BgColor = new SolidBrush(Color.FromArgb(128, 128, 128));
52 | public Brush UnChecked_ShadowColor = new SolidBrush(Color.FromArgb(98, 98, 98));
53 |
54 |
55 | public GUICommandItem()
56 | {
57 | }
58 |
59 | public GUICommandItem(BlockListType cmd_mode, string cmd_name)
60 | {
61 | CommandMode = cmd_mode;
62 | CommandName = cmd_name;
63 | }
64 |
65 | public GUICommandItem(BlockListType cmd_mode, string cmd_name, string display_name, CommandTypes command_type, string[] values, string tooltip)
66 | {
67 | CommandMode = cmd_mode;
68 | CommandName = cmd_name;
69 | DisplayName = display_name;
70 | this.CommandType = command_type;
71 |
72 | if (values != null)
73 | Values = values;
74 |
75 | ToolTip = tooltip;
76 | }
77 |
78 | public GUICommandItem Clone(Control sender)
79 | {
80 | GUICommandItem new_instance = new GUICommandItem(this.CommandMode, this.CommandName, this.DisplayName, this.CommandType, null, this.ToolTip);
81 |
82 |
83 | //Values
84 | if (this.Values != null)
85 | {
86 | new_instance.Values = new string[this.Values.Length];
87 |
88 | for (int i = 0; i < this.Values.Length; i++)
89 | {
90 | new_instance.Values[i] = this.Values[i];
91 | }
92 | }
93 |
94 | new_instance.Checked = this.Checked;
95 |
96 | new_instance.BgColor = this.BgColor;
97 | new_instance.ShadowColor = this.ShadowColor;
98 |
99 | new_instance.UnChecked_BgColor = this.UnChecked_BgColor;
100 | new_instance.UnChecked_ShadowColor = this.UnChecked_ShadowColor;
101 |
102 | return new_instance;
103 | }
104 | }
105 |
106 |
107 | public class GUICommands
108 | {
109 | private static object _copyed_object = null;
110 |
111 | public static object GetCopyedObject()
112 | {
113 | return _copyed_object;
114 | }
115 |
116 |
117 | public static string GetNextForLoopIndexName(Control sender)
118 | {
119 | HelloApps.GUI.CommandEditorClass top_commandEditorClass = HelloApps.GUI.GUIUtils.GetEditorInstance(sender);
120 | return top_commandEditorClass.GetNextForLoopIndexName();
121 | }
122 |
123 |
124 | public static string GetStringWithUniquePostfix(string name, Control sender)
125 | {
126 | return GetStringWithUniquePostfix(name, sender, 1);
127 | }
128 |
129 | public static string GetStringWithUniquePostfix(string name, Control sender, int start_ind)
130 | {
131 | HelloApps.GUI.CommandEditorClass top_commandEditorClass = HelloApps.GUI.GUIUtils.GetEditorInstance(sender);
132 | Dictionary stringToIntMapping = top_commandEditorClass._stringToIntMapping;
133 |
134 |
135 | int count = 0;
136 |
137 | if (stringToIntMapping.ContainsKey(name))
138 | {
139 | count = stringToIntMapping[name];
140 | count = count + 1;
141 | stringToIntMapping[name] = count;
142 | }
143 | else
144 | {
145 | count = start_ind;
146 | stringToIntMapping.Add(name, count);
147 | }
148 |
149 | return name + count.ToString();
150 | }
151 |
152 |
153 | public static GUICommandItem GetCmdModeName(string recv_cmd, string[] default_values, Control sender)
154 | {
155 | GUICommandItem new_item = new GUICommandItem();
156 |
157 | //bool is_korean = false;
158 |
159 | if (default_values != null)
160 | new_item.Values = default_values;
161 |
162 | string default_target_name0 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 0);
163 | string default_target_name1 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 1);
164 | string default_target_name2 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 2);
165 | string default_target_name3 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 3);
166 | string default_target_name4 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 4);
167 | string default_target_name5 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 5);
168 |
169 | if (recv_cmd == "Paste")
170 | {
171 | new_item.CommandMode = BlockListType.Paste;
172 | new_item.CommandName = recv_cmd;
173 | }
174 | else if (recv_cmd == "EmptyLine")
175 | {
176 | new_item.CommandMode = BlockListType.Item;
177 | new_item.CommandName = recv_cmd;
178 | new_item.CommandType = CommandTypes.EmptyLine;
179 | }
180 | else
181 | {
182 | new_item.CommandMode = BlockListType.Item;
183 | new_item.CommandName = "Expression";
184 | new_item.DisplayName = new_item.CommandName;
185 | new_item.CommandType = CommandTypes.Expr1;
186 |
187 |
188 | if (!string.IsNullOrEmpty(recv_cmd))
189 | HelloApps.GUI.GUIUtils.SetSafeArrayValue(new_item.Values, 0, recv_cmd);
190 |
191 |
192 | new_item.BgColor = new SolidBrush(Color.FromArgb(0, 128, 0));
193 | new_item.ShadowColor = new SolidBrush(Color.FromArgb(0, 98, 0));
194 | }
195 |
196 |
197 |
198 | new_item.CommandMode = BlockListType.Item;
199 | new_item.CommandName = "Expression";
200 | new_item.DisplayName = new_item.CommandName;
201 | new_item.CommandType = CommandTypes.Expr1;
202 |
203 |
204 | if (!string.IsNullOrEmpty(recv_cmd))
205 | HelloApps.GUI.GUIUtils.SetSafeArrayValue(new_item.Values, 0, recv_cmd);
206 |
207 |
208 | new_item.BgColor = new SolidBrush(Color.FromArgb(0, 128, 0));
209 | new_item.ShadowColor = new SolidBrush(Color.FromArgb(0, 98, 0));
210 |
211 | return new_item;
212 | }
213 |
214 |
215 | }
216 | }
217 |
--------------------------------------------------------------------------------
/Arduino.PLC/GUI/GUICommon.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Drawing;
5 | using System.Drawing.Drawing2D;
6 | using System.Windows.Forms;
7 |
8 | namespace HelloApps.GUI
9 | {
10 | public class BlockMaxSize
11 | {
12 | public int Width = 0;
13 | public int Height = 0;
14 | }
15 |
16 |
17 | public class GlobalInstance
18 | {
19 | public static string LastAddedOp1 = string.Empty;
20 | public static string LastAddedOp2 = string.Empty;
21 | }
22 |
23 | public enum BlockListType
24 | {
25 | None = 0, Editor = 1, Item = 2, Block = 3, Option = 4, Paste = 5
26 | }
27 |
28 | public enum DragOverType
29 | {
30 | None = 0, Upper = 1, Inner = 2, Bottom = 3
31 | }
32 |
33 | public enum InstaceType
34 | {
35 | None = 0, Editor = 1, Item = 2, Block = 3, Option = 4
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/Arduino.PLC/GUI/GUIUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Drawing;
5 | using System.Drawing.Drawing2D;
6 | using System.Windows.Forms;
7 |
8 | namespace HelloApps.GUI
9 | {
10 |
11 | public class GUIUtils
12 | {
13 | public static CommandEditorClass GetEditorInstance(Control current_instance)
14 | {
15 | if (current_instance == null)
16 | return null;
17 |
18 | if (current_instance.GetType().Equals(typeof(CommandEditorClass)))
19 | return (CommandEditorClass)current_instance;
20 |
21 | if (current_instance.Parent == null)
22 | return null;
23 |
24 | Control parent_control = current_instance.Parent;
25 |
26 | while (parent_control != null && !parent_control.GetType().Equals(typeof(CommandEditorClass)))
27 | {
28 | if (parent_control.Parent != null)
29 | parent_control = parent_control.Parent;
30 | else
31 | break;
32 | }
33 |
34 | if (parent_control.GetType().Equals(typeof(CommandEditorClass)))
35 | return (CommandEditorClass)parent_control;
36 | else
37 | return null;
38 | }
39 |
40 | public static string[] SetSafeArrayValue(string[] arr, string value)
41 | {
42 | return SetSafeArrayValue(arr, 0, value);
43 | }
44 |
45 |
46 | public static string[] SetSafeArrayValue(string[] arr, int pos, string value)
47 | {
48 | if (arr != null && pos < arr.Length)
49 | arr[pos] = value;
50 |
51 | return arr;
52 | }
53 |
54 | public static string GetSafeArrayValue(string[] arr)
55 | {
56 | return GetSafeArrayValue(arr, 0);
57 | }
58 |
59 | public static string GetSafeArrayValue(string[] arr, int pos)
60 | {
61 | if (arr != null && pos < arr.Length)
62 | return arr[pos];
63 | else
64 | return string.Empty;
65 | }
66 |
67 |
68 | public static string[] CreateStringArray(int size)
69 | {
70 | string[] arr = new string[size];
71 |
72 | for (int i = 0; i < size; i++)
73 | arr[i] = string.Empty;
74 |
75 | return arr;
76 | }
77 |
78 | public static string[] CreateStringArray(object p1)
79 | {
80 | string[] arr = new string[1];
81 |
82 | if (p1 == null)
83 | arr[0] = string.Empty;
84 | else
85 | arr[0] = p1.ToString();
86 |
87 | return arr;
88 | }
89 |
90 | public static string[] CreateStringArray(object p1, object p2)
91 | {
92 | string[] arr = new string[2];
93 |
94 | if (p1 == null)
95 | arr[0] = string.Empty;
96 | else
97 | arr[0] = p1.ToString();
98 |
99 | if (p2 == null)
100 | arr[1] = string.Empty;
101 | else
102 | arr[1] = p2.ToString();
103 |
104 | return arr;
105 | }
106 |
107 | public static string[] CreateStringArray(object p1, object p2, object p3)
108 | {
109 | string[] arr = new string[3];
110 |
111 | if (p1 == null)
112 | arr[0] = string.Empty;
113 | else
114 | arr[0] = p1.ToString();
115 |
116 | if (p2 == null)
117 | arr[1] = string.Empty;
118 | else
119 | arr[1] = p2.ToString();
120 |
121 | if (p3 == null)
122 | arr[2] = string.Empty;
123 | else
124 | arr[2] = p3.ToString();
125 |
126 | return arr;
127 | }
128 |
129 |
130 | public static string[] CreateStringArray(object p1, object p2, object p3, object p4)
131 | {
132 | string[] arr = new string[4];
133 |
134 | if (p1 == null)
135 | arr[0] = string.Empty;
136 | else
137 | arr[0] = p1.ToString();
138 |
139 | if (p2 == null)
140 | arr[1] = string.Empty;
141 | else
142 | arr[1] = p2.ToString();
143 |
144 | if (p3 == null)
145 | arr[2] = string.Empty;
146 | else
147 | arr[2] = p3.ToString();
148 |
149 | if (p4 == null)
150 | arr[3] = string.Empty;
151 | else
152 | arr[3] = p4.ToString();
153 |
154 | return arr;
155 | }
156 |
157 |
158 | public static string[] CreateStringArray(object p1, object p2, object p3, object p4, object p5)
159 | {
160 | string[] arr = new string[5];
161 |
162 | if (p1 == null)
163 | arr[0] = string.Empty;
164 | else
165 | arr[0] = p1.ToString();
166 |
167 | if (p2 == null)
168 | arr[1] = string.Empty;
169 | else
170 | arr[1] = p2.ToString();
171 |
172 | if (p3 == null)
173 | arr[2] = string.Empty;
174 | else
175 | arr[2] = p3.ToString();
176 |
177 | if (p4 == null)
178 | arr[3] = string.Empty;
179 | else
180 | arr[3] = p4.ToString();
181 |
182 | if (p5 == null)
183 | arr[4] = string.Empty;
184 | else
185 | arr[4] = p5.ToString();
186 |
187 | return arr;
188 | }
189 |
190 | public static string[] GetStringArray(string str)
191 | {
192 | if (string.IsNullOrEmpty(str))
193 | return null;
194 |
195 | string[] arr = str.Split(new char[] { ' ', ',', '\t' }, StringSplitOptions.RemoveEmptyEntries);
196 | return arr;
197 | }
198 |
199 | public static string[] GetStringArray(string str1, string str2)
200 | {
201 | if (string.IsNullOrEmpty(str1) && string.IsNullOrEmpty(str2))
202 | return null;
203 |
204 |
205 | string[] arr1 = null;
206 | string[] arr2 = null;
207 |
208 | int arr1_size = 0;
209 | int arr2_size = 0;
210 |
211 | if (!string.IsNullOrEmpty(str1))
212 | {
213 | arr1 = str1.Split(new char[] { ' ', ',', '\t' }, StringSplitOptions.RemoveEmptyEntries);
214 | arr1_size = arr1.Length;
215 | }
216 |
217 | if (!string.IsNullOrEmpty(str2))
218 | {
219 | arr2 = str2.Split(new char[] { ' ', ',', '\t' }, StringSplitOptions.RemoveEmptyEntries);
220 | arr2_size = arr2.Length;
221 | }
222 |
223 | string[] arr = new string[arr1_size + arr2_size];
224 |
225 | int ind = 0;
226 |
227 | for (int i = 0; i < arr1_size; i++)
228 | {
229 | arr[ind] = arr1[i];
230 | ind++;
231 | }
232 |
233 | for (int i = 0; i < arr2_size; i++)
234 | {
235 | arr[ind] = arr2[i];
236 | ind++;
237 | }
238 |
239 | return arr;
240 | }
241 |
242 |
243 | public static float[] GetFloatArray(string str)
244 | {
245 | if (string.IsNullOrEmpty(str))
246 | return null;
247 |
248 | string[] arr = GetStringArray(str);
249 |
250 | if (arr != null)
251 | {
252 | float[] vars = new float[arr.Length];
253 |
254 | for (int i = 0; i < arr.Length; i++)
255 | {
256 | vars[i] = float.Parse(arr[i]);
257 | }
258 |
259 | return vars;
260 | }
261 | else
262 | return null;
263 | }
264 |
265 |
266 | public static int[] GetIntArray(string str)
267 | {
268 | if (string.IsNullOrEmpty(str))
269 | return null;
270 |
271 | string[] arr = GetStringArray(str);
272 |
273 | if (arr != null)
274 | {
275 | int[] vars = new int[arr.Length];
276 |
277 | for (int i = 0; i < arr.Length; i++)
278 | {
279 | vars[i] = int.Parse(arr[i]);
280 | }
281 |
282 | return vars;
283 | }
284 | else
285 | return null;
286 | }
287 |
288 | public static string GetStringFromFloatArray(float[] vars)
289 | {
290 | string res = string.Empty;
291 |
292 | if (vars != null)
293 | {
294 | for (int i = 0; i < vars.Length; i++)
295 | {
296 | if (i < (vars.Length - 1))
297 | res = res + vars[i].ToString() + " ";
298 | else
299 | res = res + vars[i].ToString();
300 | }
301 | }
302 |
303 | return res;
304 | }
305 |
306 | public static float[] CloneFloatArray(float[] vars)
307 | {
308 | if (vars == null)
309 | return null;
310 |
311 | float[] new_vals = new float[vars.Length];
312 |
313 | for (int i = 0; i < vars.Length; i++)
314 | {
315 | new_vals[i] = vars[i];
316 | }
317 |
318 | return new_vals;
319 | }
320 |
321 | public static float[] GetFloatArray(float x, float y, float z)
322 | {
323 | float[] new_vals = new float[3];
324 |
325 | new_vals[0] = x;
326 | new_vals[1] = y;
327 | new_vals[2] = z;
328 |
329 | return new_vals;
330 | }
331 |
332 | public static bool IsChanged_FloatArray(float[] op1, float[] op2)
333 | {
334 | //Equal True
335 | //Differ False
336 | bool res = false;
337 |
338 | if (op1 == null || op2 == null)
339 | return false;
340 |
341 | if (op1.Length != op2.Length)
342 | return false;
343 |
344 | for (int i = 0; i < op1.Length; i++)
345 | {
346 | if (op1[i] != op2[i])
347 | {
348 | res = true;
349 | break;
350 | }
351 | }
352 |
353 | return res;
354 | }
355 |
356 | public static Color CloneColor(Color org)
357 | {
358 | Color new_color = Color.FromArgb(org.R, org.G, org.B);
359 | return new_color;
360 | }
361 | }
362 |
363 | }
364 |
--------------------------------------------------------------------------------
/Arduino.PLC/GUI/PositionGrid.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows.Forms;
5 | using System.Drawing;
6 | using System.Drawing.Drawing2D;
7 | using System.ComponentModel;
8 |
9 | namespace HelloApps.GUI
10 | {
11 | public class PositionGrid : PictureBox
12 | {
13 | public delegate void ChangeNotifyHandler(int x, int y);
14 | public ChangeNotifyHandler ChangeNotifyEvent = null;
15 |
16 | public int Pos_X = 0;
17 | public int Pos_Y = 0;
18 |
19 | public PositionGrid()
20 | {
21 | this.Paint += new System.Windows.Forms.PaintEventHandler(this.OnPaint);
22 | this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnMouseDown);
23 | }
24 |
25 | public void SetPosition(float x, float y)
26 | {
27 | Pos_X = (int)x;
28 | Pos_Y = (int)(y * -1);
29 | }
30 |
31 | private void OnMouseDown(object sender, MouseEventArgs e)
32 | {
33 | Pos_X = e.X - 100;
34 | Pos_Y = e.Y - 100;
35 |
36 | this.Invalidate();
37 |
38 | if (ChangeNotifyEvent != null)
39 | ChangeNotifyEvent(Pos_X, Pos_Y);
40 | }
41 |
42 | private void OnPaint(object sender, PaintEventArgs e)
43 | {
44 | e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
45 |
46 | int cur_pos_x = Pos_X + 100;
47 | int cur_pos_y = Pos_Y + 100;
48 |
49 | for (int i = 0; i < 20; i++)
50 | {
51 | e.Graphics.DrawLine(Pens.Black, i * 10 - 1, 0, i * 10 - 1, 200);
52 | e.Graphics.DrawLine(Pens.Black, 0, i * 10 - 1, 200, i * 10 - 1);
53 | }
54 |
55 | e.Graphics.DrawLine(Pens.Black, 100 - 2, 0, 100 - 2, 200);
56 | e.Graphics.DrawLine(Pens.Black, 100, 0, 100, 200);
57 |
58 | e.Graphics.DrawLine(Pens.Black, 0, 100 - 2, 200, 100 - 2);
59 | e.Graphics.DrawLine(Pens.Black, 0, 100, 200, 100);
60 |
61 | e.Graphics.FillEllipse(Brushes.Green, new Rectangle(cur_pos_x - 11, cur_pos_y - 11, 21, 21));
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Arduino.PLC/HelloApps.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/HelloApps.ico
--------------------------------------------------------------------------------
/Arduino.PLC/HelloApps_Blue.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/HelloApps_Blue.ico
--------------------------------------------------------------------------------
/Arduino.PLC/HelloApps_Logo_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/HelloApps_Logo_4.png
--------------------------------------------------------------------------------
/Arduino.PLC/HelloApps_Violet.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/HelloApps_Violet.ico
--------------------------------------------------------------------------------
/Arduino.PLC/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 |
5 | namespace HelloApps
6 | {
7 | static class Program
8 | {
9 | [STAThread]
10 | static void Main(string[] args)
11 | {
12 | Application.EnableVisualStyles();
13 | Application.SetCompatibleTextRenderingDefault(false);
14 | Application.Run(new MainForm(args));
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Arduino.PLC/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("SPL-Duino Editor")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("HelloApps")]
9 | [assembly: AssemblyProduct("SPL-Duino Editor")]
10 | [assembly: AssemblyCopyright("Copyright © HelloApps 2013")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: AssemblyVersion("1.0.0.0")]
17 | [assembly: AssemblyFileVersion("1.0.0.0")]
18 |
--------------------------------------------------------------------------------
/Arduino.PLC/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 HelloApps.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", "4.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("HelloApps.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 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap Remove {
67 | get {
68 | object obj = ResourceManager.GetObject("Remove", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap splg_icon1 {
77 | get {
78 | object obj = ResourceManager.GetObject("splg_icon1", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Looks up a localized resource of type System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap splg_icon2 {
87 | get {
88 | object obj = ResourceManager.GetObject("splg_icon2", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// Looks up a localized resource of type System.Drawing.Bitmap.
95 | ///
96 | internal static System.Drawing.Bitmap splg_icon3 {
97 | get {
98 | object obj = ResourceManager.GetObject("splg_icon3", resourceCulture);
99 | return ((System.Drawing.Bitmap)(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// Looks up a localized resource of type System.Drawing.Bitmap.
105 | ///
106 | internal static System.Drawing.Bitmap splg_icon4 {
107 | get {
108 | object obj = ResourceManager.GetObject("splg_icon4", resourceCulture);
109 | return ((System.Drawing.Bitmap)(obj));
110 | }
111 | }
112 |
113 | ///
114 | /// Looks up a localized resource of type System.Drawing.Bitmap.
115 | ///
116 | internal static System.Drawing.Bitmap splg_icon5 {
117 | get {
118 | object obj = ResourceManager.GetObject("splg_icon5", resourceCulture);
119 | return ((System.Drawing.Bitmap)(obj));
120 | }
121 | }
122 |
123 | ///
124 | /// Looks up a localized resource of type System.Drawing.Bitmap.
125 | ///
126 | internal static System.Drawing.Bitmap splg_icon6 {
127 | get {
128 | object obj = ResourceManager.GetObject("splg_icon6", resourceCulture);
129 | return ((System.Drawing.Bitmap)(obj));
130 | }
131 | }
132 |
133 | ///
134 | /// Looks up a localized resource of type System.Drawing.Bitmap.
135 | ///
136 | internal static System.Drawing.Bitmap splg_icon7 {
137 | get {
138 | object obj = ResourceManager.GetObject("splg_icon7", resourceCulture);
139 | return ((System.Drawing.Bitmap)(obj));
140 | }
141 | }
142 |
143 | ///
144 | /// Looks up a localized resource of type System.Drawing.Bitmap.
145 | ///
146 | internal static System.Drawing.Bitmap splg_icon8 {
147 | get {
148 | object obj = ResourceManager.GetObject("splg_icon8", resourceCulture);
149 | return ((System.Drawing.Bitmap)(obj));
150 | }
151 | }
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/Arduino.PLC/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 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\Remove.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\splg_icon1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\splg_icon2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | ..\Resources\splg_icon3.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | ..\Resources\splg_icon4.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
135 |
136 |
137 | ..\Resources\splg_icon5.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
138 |
139 |
140 |
141 | ..\Resources\splg_icon6.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
142 |
143 |
144 | ..\Resources\splg_icon7.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
145 |
146 |
147 | ..\Resources\splg_icon8.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
148 |
149 |
--------------------------------------------------------------------------------
/Arduino.PLC/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 HelloApps.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.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 | }
27 |
--------------------------------------------------------------------------------
/Arduino.PLC/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/Add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/Add.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/BooleanOp_Equal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/BooleanOp_Equal.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/BooleanOp_Inter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/BooleanOp_Inter.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/BooleanOp_Minus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/BooleanOp_Minus.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/BooleanOp_Plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/BooleanOp_Plus.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/CheckBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/CheckBox.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/EmptyBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/EmptyBox.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/EtcBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/EtcBox.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/Expand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/Expand.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/Remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/Remove.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/Shrink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/Shrink.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/splg_icon1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/splg_icon1.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/splg_icon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/splg_icon2.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/splg_icon3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/splg_icon3.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/splg_icon4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/splg_icon4.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/splg_icon5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/splg_icon5.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/splg_icon6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/splg_icon6.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/splg_icon7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/splg_icon7.png
--------------------------------------------------------------------------------
/Arduino.PLC/Resources/splg_icon8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/Resources/splg_icon8.png
--------------------------------------------------------------------------------
/Arduino.PLC/SPLConsole.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace HelloApps
2 | {
3 | partial class SPLConsole
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(SPLConsole));
33 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
34 | this.panelControl1 = new System.Windows.Forms.Panel();
35 | this.button2 = new System.Windows.Forms.Button();
36 | this.label2 = new System.Windows.Forms.Label();
37 | this.comboBox1 = new System.Windows.Forms.ComboBox();
38 | this.textEdit1 = new System.Windows.Forms.TextBox();
39 | this.tabControl1 = new System.Windows.Forms.TabControl();
40 | this.tabPage1 = new System.Windows.Forms.TabPage();
41 | this.listBox1 = new System.Windows.Forms.ListBox();
42 | this.panel2 = new System.Windows.Forms.Panel();
43 | this.panelControl2 = new System.Windows.Forms.Panel();
44 | this.button1 = new System.Windows.Forms.Button();
45 | this.panelControl3 = new System.Windows.Forms.Panel();
46 | this.tabControl2 = new System.Windows.Forms.TabControl();
47 | this.tabPage3 = new System.Windows.Forms.TabPage();
48 | this.textBox_sketch = new System.Windows.Forms.TextBox();
49 | this.tabPage2 = new System.Windows.Forms.TabPage();
50 | this.textBox_raw = new System.Windows.Forms.TextBox();
51 | this.tabPage4 = new System.Windows.Forms.TabPage();
52 | this.panel1 = new System.Windows.Forms.Panel();
53 | this.button6 = new System.Windows.Forms.Button();
54 | this.button5 = new System.Windows.Forms.Button();
55 | this.button4 = new System.Windows.Forms.Button();
56 | this.button3 = new System.Windows.Forms.Button();
57 | this.timer_exec = new System.Windows.Forms.Timer(this.components);
58 | this.timer_monitering = new System.Windows.Forms.Timer(this.components);
59 | this.timer_serial_receive = new System.Windows.Forms.Timer(this.components);
60 | this.timer_check_running = new System.Windows.Forms.Timer(this.components);
61 | this.timer_loginfo = new System.Windows.Forms.Timer(this.components);
62 | this.tableLayoutPanel1.SuspendLayout();
63 | this.panelControl1.SuspendLayout();
64 | this.tabControl1.SuspendLayout();
65 | this.tabPage1.SuspendLayout();
66 | this.panelControl2.SuspendLayout();
67 | this.panelControl3.SuspendLayout();
68 | this.tabControl2.SuspendLayout();
69 | this.tabPage3.SuspendLayout();
70 | this.tabPage2.SuspendLayout();
71 | this.tabPage4.SuspendLayout();
72 | this.panel1.SuspendLayout();
73 | this.SuspendLayout();
74 | //
75 | // tableLayoutPanel1
76 | //
77 | this.tableLayoutPanel1.ColumnCount = 5;
78 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 11F));
79 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
80 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 11F));
81 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 343F));
82 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 11F));
83 | this.tableLayoutPanel1.Controls.Add(this.panelControl1, 1, 2);
84 | this.tableLayoutPanel1.Controls.Add(this.tabControl1, 1, 1);
85 | this.tableLayoutPanel1.Controls.Add(this.panelControl2, 3, 2);
86 | this.tableLayoutPanel1.Controls.Add(this.panelControl3, 3, 1);
87 | this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
88 | this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
89 | this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
90 | this.tableLayoutPanel1.Name = "tableLayoutPanel1";
91 | this.tableLayoutPanel1.RowCount = 4;
92 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 11F));
93 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
94 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F));
95 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 11F));
96 | this.tableLayoutPanel1.Size = new System.Drawing.Size(1152, 605);
97 | this.tableLayoutPanel1.TabIndex = 0;
98 | //
99 | // panelControl1
100 | //
101 | this.panelControl1.Controls.Add(this.button2);
102 | this.panelControl1.Controls.Add(this.label2);
103 | this.panelControl1.Controls.Add(this.comboBox1);
104 | this.panelControl1.Controls.Add(this.textEdit1);
105 | this.panelControl1.Dock = System.Windows.Forms.DockStyle.Fill;
106 | this.panelControl1.Location = new System.Drawing.Point(14, 556);
107 | this.panelControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
108 | this.panelControl1.Name = "panelControl1";
109 | this.panelControl1.Size = new System.Drawing.Size(770, 34);
110 | this.panelControl1.TabIndex = 1;
111 | //
112 | // button2
113 | //
114 | this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
115 | this.button2.Location = new System.Drawing.Point(632, 7);
116 | this.button2.Name = "button2";
117 | this.button2.Size = new System.Drawing.Size(131, 23);
118 | this.button2.TabIndex = 11;
119 | this.button2.Text = "Send Message";
120 | this.button2.UseVisualStyleBackColor = true;
121 | this.button2.Click += new System.EventHandler(this.button2_Click);
122 | //
123 | // label2
124 | //
125 | this.label2.AutoSize = true;
126 | this.label2.Location = new System.Drawing.Point(16, 11);
127 | this.label2.Name = "label2";
128 | this.label2.Size = new System.Drawing.Size(67, 15);
129 | this.label2.TabIndex = 10;
130 | this.label2.Text = "Message";
131 | //
132 | // comboBox1
133 | //
134 | this.comboBox1.FormattingEnabled = true;
135 | this.comboBox1.Location = new System.Drawing.Point(471, 8);
136 | this.comboBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
137 | this.comboBox1.Name = "comboBox1";
138 | this.comboBox1.Size = new System.Drawing.Size(138, 23);
139 | this.comboBox1.TabIndex = 9;
140 | //
141 | // textEdit1
142 | //
143 | this.textEdit1.Location = new System.Drawing.Point(103, 8);
144 | this.textEdit1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
145 | this.textEdit1.Name = "textEdit1";
146 | this.textEdit1.Size = new System.Drawing.Size(351, 24);
147 | this.textEdit1.TabIndex = 0;
148 | this.textEdit1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textEdit1_KeyDown);
149 | //
150 | // tabControl1
151 | //
152 | this.tabControl1.Controls.Add(this.tabPage1);
153 | this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
154 | this.tabControl1.Location = new System.Drawing.Point(14, 15);
155 | this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
156 | this.tabControl1.Name = "tabControl1";
157 | this.tabControl1.SelectedIndex = 0;
158 | this.tabControl1.Size = new System.Drawing.Size(770, 533);
159 | this.tabControl1.TabIndex = 2;
160 | //
161 | // tabPage1
162 | //
163 | this.tabPage1.Controls.Add(this.listBox1);
164 | this.tabPage1.Controls.Add(this.panel2);
165 | this.tabPage1.Location = new System.Drawing.Point(4, 25);
166 | this.tabPage1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
167 | this.tabPage1.Name = "tabPage1";
168 | this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
169 | this.tabPage1.Size = new System.Drawing.Size(762, 504);
170 | this.tabPage1.TabIndex = 0;
171 | this.tabPage1.Text = "Console";
172 | this.tabPage1.UseVisualStyleBackColor = true;
173 | //
174 | // listBox1
175 | //
176 | this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
177 | this.listBox1.FormattingEnabled = true;
178 | this.listBox1.ItemHeight = 15;
179 | this.listBox1.Location = new System.Drawing.Point(3, 4);
180 | this.listBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
181 | this.listBox1.Name = "listBox1";
182 | this.listBox1.Size = new System.Drawing.Size(756, 462);
183 | this.listBox1.TabIndex = 0;
184 | this.listBox1.DoubleClick += new System.EventHandler(this.listBox1_DoubleClick);
185 | //
186 | // panel2
187 | //
188 | this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
189 | this.panel2.Location = new System.Drawing.Point(3, 466);
190 | this.panel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
191 | this.panel2.Name = "panel2";
192 | this.panel2.Size = new System.Drawing.Size(756, 34);
193 | this.panel2.TabIndex = 2;
194 | //
195 | // panelControl2
196 | //
197 | this.panelControl2.Controls.Add(this.button1);
198 | this.panelControl2.Dock = System.Windows.Forms.DockStyle.Fill;
199 | this.panelControl2.Location = new System.Drawing.Point(801, 556);
200 | this.panelControl2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
201 | this.panelControl2.Name = "panelControl2";
202 | this.panelControl2.Size = new System.Drawing.Size(337, 34);
203 | this.panelControl2.TabIndex = 3;
204 | //
205 | // button1
206 | //
207 | this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
208 | this.button1.Location = new System.Drawing.Point(203, 7);
209 | this.button1.Name = "button1";
210 | this.button1.Size = new System.Drawing.Size(125, 23);
211 | this.button1.TabIndex = 1;
212 | this.button1.Text = "Close";
213 | this.button1.UseVisualStyleBackColor = true;
214 | this.button1.Click += new System.EventHandler(this.button1_Click);
215 | //
216 | // panelControl3
217 | //
218 | this.panelControl3.Controls.Add(this.tabControl2);
219 | this.panelControl3.Dock = System.Windows.Forms.DockStyle.Fill;
220 | this.panelControl3.Location = new System.Drawing.Point(801, 15);
221 | this.panelControl3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
222 | this.panelControl3.Name = "panelControl3";
223 | this.panelControl3.Size = new System.Drawing.Size(337, 533);
224 | this.panelControl3.TabIndex = 4;
225 | //
226 | // tabControl2
227 | //
228 | this.tabControl2.Controls.Add(this.tabPage3);
229 | this.tabControl2.Controls.Add(this.tabPage2);
230 | this.tabControl2.Controls.Add(this.tabPage4);
231 | this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
232 | this.tabControl2.Location = new System.Drawing.Point(0, 0);
233 | this.tabControl2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
234 | this.tabControl2.Name = "tabControl2";
235 | this.tabControl2.SelectedIndex = 0;
236 | this.tabControl2.Size = new System.Drawing.Size(337, 533);
237 | this.tabControl2.TabIndex = 0;
238 | //
239 | // tabPage3
240 | //
241 | this.tabPage3.Controls.Add(this.textBox_sketch);
242 | this.tabPage3.Location = new System.Drawing.Point(4, 25);
243 | this.tabPage3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
244 | this.tabPage3.Name = "tabPage3";
245 | this.tabPage3.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
246 | this.tabPage3.Size = new System.Drawing.Size(329, 504);
247 | this.tabPage3.TabIndex = 0;
248 | this.tabPage3.Text = "Generated C Code";
249 | this.tabPage3.UseVisualStyleBackColor = true;
250 | //
251 | // textBox_sketch
252 | //
253 | this.textBox_sketch.Dock = System.Windows.Forms.DockStyle.Fill;
254 | this.textBox_sketch.Location = new System.Drawing.Point(3, 4);
255 | this.textBox_sketch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
256 | this.textBox_sketch.Multiline = true;
257 | this.textBox_sketch.Name = "textBox_sketch";
258 | this.textBox_sketch.ScrollBars = System.Windows.Forms.ScrollBars.Both;
259 | this.textBox_sketch.Size = new System.Drawing.Size(323, 496);
260 | this.textBox_sketch.TabIndex = 1;
261 | this.textBox_sketch.WordWrap = false;
262 | //
263 | // tabPage2
264 | //
265 | this.tabPage2.Controls.Add(this.textBox_raw);
266 | this.tabPage2.Location = new System.Drawing.Point(4, 25);
267 | this.tabPage2.Name = "tabPage2";
268 | this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
269 | this.tabPage2.Size = new System.Drawing.Size(329, 504);
270 | this.tabPage2.TabIndex = 1;
271 | this.tabPage2.Text = "Sketch Code";
272 | this.tabPage2.UseVisualStyleBackColor = true;
273 | //
274 | // textBox_raw
275 | //
276 | this.textBox_raw.Dock = System.Windows.Forms.DockStyle.Fill;
277 | this.textBox_raw.Location = new System.Drawing.Point(3, 3);
278 | this.textBox_raw.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
279 | this.textBox_raw.Multiline = true;
280 | this.textBox_raw.Name = "textBox_raw";
281 | this.textBox_raw.ScrollBars = System.Windows.Forms.ScrollBars.Both;
282 | this.textBox_raw.Size = new System.Drawing.Size(323, 498);
283 | this.textBox_raw.TabIndex = 2;
284 | this.textBox_raw.WordWrap = false;
285 | //
286 | // tabPage4
287 | //
288 | this.tabPage4.Controls.Add(this.panel1);
289 | this.tabPage4.Location = new System.Drawing.Point(4, 25);
290 | this.tabPage4.Name = "tabPage4";
291 | this.tabPage4.Size = new System.Drawing.Size(329, 504);
292 | this.tabPage4.TabIndex = 2;
293 | this.tabPage4.Text = "Testing";
294 | this.tabPage4.UseVisualStyleBackColor = true;
295 | //
296 | // panel1
297 | //
298 | this.panel1.Controls.Add(this.button6);
299 | this.panel1.Controls.Add(this.button5);
300 | this.panel1.Controls.Add(this.button4);
301 | this.panel1.Controls.Add(this.button3);
302 | this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
303 | this.panel1.Location = new System.Drawing.Point(0, 0);
304 | this.panel1.Name = "panel1";
305 | this.panel1.Size = new System.Drawing.Size(329, 504);
306 | this.panel1.TabIndex = 0;
307 | //
308 | // button6
309 | //
310 | this.button6.Location = new System.Drawing.Point(36, 249);
311 | this.button6.Name = "button6";
312 | this.button6.Size = new System.Drawing.Size(222, 36);
313 | this.button6.TabIndex = 3;
314 | this.button6.Text = "P00000=0";
315 | this.button6.UseVisualStyleBackColor = true;
316 | this.button6.Click += new System.EventHandler(this.button6_Click);
317 | //
318 | // button5
319 | //
320 | this.button5.Location = new System.Drawing.Point(36, 186);
321 | this.button5.Name = "button5";
322 | this.button5.Size = new System.Drawing.Size(222, 36);
323 | this.button5.TabIndex = 2;
324 | this.button5.Text = "P00000=1";
325 | this.button5.UseVisualStyleBackColor = true;
326 | this.button5.Click += new System.EventHandler(this.button5_Click);
327 | //
328 | // button4
329 | //
330 | this.button4.Location = new System.Drawing.Point(36, 94);
331 | this.button4.Name = "button4";
332 | this.button4.Size = new System.Drawing.Size(222, 36);
333 | this.button4.TabIndex = 1;
334 | this.button4.Text = "TESTING OFF";
335 | this.button4.UseVisualStyleBackColor = true;
336 | this.button4.Click += new System.EventHandler(this.button4_Click);
337 | //
338 | // button3
339 | //
340 | this.button3.Location = new System.Drawing.Point(36, 34);
341 | this.button3.Name = "button3";
342 | this.button3.Size = new System.Drawing.Size(222, 36);
343 | this.button3.TabIndex = 0;
344 | this.button3.Text = "TESTING ON";
345 | this.button3.UseVisualStyleBackColor = true;
346 | this.button3.Click += new System.EventHandler(this.button3_Click);
347 | //
348 | // timer_exec
349 | //
350 | this.timer_exec.Tick += new System.EventHandler(this.timer_exec_Tick);
351 | //
352 | // timer_monitering
353 | //
354 | this.timer_monitering.Tick += new System.EventHandler(this.timer_monitering_Tick);
355 | //
356 | // timer_serial_receive
357 | //
358 | this.timer_serial_receive.Enabled = true;
359 | this.timer_serial_receive.Interval = 10;
360 | this.timer_serial_receive.Tick += new System.EventHandler(this.timer_serial_receive_Tick);
361 | //
362 | // timer_check_running
363 | //
364 | this.timer_check_running.Enabled = true;
365 | this.timer_check_running.Interval = 5000;
366 | this.timer_check_running.Tick += new System.EventHandler(this.timer_check_running_Tick);
367 | //
368 | // timer_loginfo
369 | //
370 | this.timer_loginfo.Enabled = true;
371 | this.timer_loginfo.Interval = 5;
372 | this.timer_loginfo.Tick += new System.EventHandler(this.timer_loginfo_Tick);
373 | //
374 | // SPLConsole
375 | //
376 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
377 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
378 | this.ClientSize = new System.Drawing.Size(1152, 605);
379 | this.Controls.Add(this.tableLayoutPanel1);
380 | this.Font = new System.Drawing.Font("Gulim", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
381 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
382 | this.KeyPreview = true;
383 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
384 | this.Name = "SPLConsole";
385 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
386 | this.Text = "Arduino Console";
387 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SPLConsole_FormClosing);
388 | this.Load += new System.EventHandler(this.SPLConsole_Load);
389 | this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SPLConsole_KeyDown);
390 | this.tableLayoutPanel1.ResumeLayout(false);
391 | this.panelControl1.ResumeLayout(false);
392 | this.panelControl1.PerformLayout();
393 | this.tabControl1.ResumeLayout(false);
394 | this.tabPage1.ResumeLayout(false);
395 | this.panelControl2.ResumeLayout(false);
396 | this.panelControl3.ResumeLayout(false);
397 | this.tabControl2.ResumeLayout(false);
398 | this.tabPage3.ResumeLayout(false);
399 | this.tabPage3.PerformLayout();
400 | this.tabPage2.ResumeLayout(false);
401 | this.tabPage2.PerformLayout();
402 | this.tabPage4.ResumeLayout(false);
403 | this.panel1.ResumeLayout(false);
404 | this.ResumeLayout(false);
405 |
406 | }
407 |
408 | #endregion
409 |
410 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
411 | private System.Windows.Forms.Panel panelControl1;
412 | private System.Windows.Forms.TextBox textEdit1;
413 | private System.Windows.Forms.TabControl tabControl1;
414 | private System.Windows.Forms.TabPage tabPage1;
415 | private System.Windows.Forms.Timer timer_exec;
416 | private System.Windows.Forms.ListBox listBox1;
417 | private System.Windows.Forms.Timer timer_monitering;
418 | private System.Windows.Forms.Panel panelControl2;
419 | private System.Windows.Forms.Panel panelControl3;
420 | private System.Windows.Forms.Timer timer_serial_receive;
421 | private System.Windows.Forms.Timer timer_check_running;
422 | private System.Windows.Forms.Timer timer_loginfo;
423 | private System.Windows.Forms.Panel panel2;
424 | private System.Windows.Forms.ComboBox comboBox1;
425 | private System.Windows.Forms.TabControl tabControl2;
426 | private System.Windows.Forms.TabPage tabPage3;
427 | private System.Windows.Forms.TextBox textBox_sketch;
428 | private System.Windows.Forms.Label label2;
429 | private System.Windows.Forms.Button button1;
430 | private System.Windows.Forms.Button button2;
431 | private System.Windows.Forms.TabPage tabPage2;
432 | private System.Windows.Forms.TextBox textBox_raw;
433 | private System.Windows.Forms.TabPage tabPage4;
434 | private System.Windows.Forms.Panel panel1;
435 | private System.Windows.Forms.Button button4;
436 | private System.Windows.Forms.Button button3;
437 | private System.Windows.Forms.Button button5;
438 | private System.Windows.Forms.Button button6;
439 | }
440 | }
--------------------------------------------------------------------------------
/Arduino.PLC/SPLEditor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | using System.IO;
11 | using System.Xml.Serialization;
12 | using System.Xml;
13 |
14 | using Microsoft.Win32;
15 | using System.Reflection;
16 | using System.Net;
17 | using System.Net.Sockets;
18 | using System.IO.Compression;
19 |
20 | namespace HelloApps
21 | {
22 |
23 | public class CustomTabControl : TabControl
24 | {
25 | public bool UpdatedFlag = false;
26 |
27 | public HelloApps.GUI.CommandEditorClass CurCmdEditorClass
28 | {
29 | get
30 | {
31 | if (this.SelectedIndex >= 0)
32 | {
33 | TabPage cur_page = this.TabPages[this.SelectedIndex];
34 |
35 | if (cur_page.Controls.Count == 1)
36 | {
37 | if (cur_page.Controls[0].GetType().Name.EndsWith("PictureBox"))
38 | {
39 | PictureBox pb = (PictureBox)cur_page.Controls[0];
40 | if (pb.Controls.Count == 1)
41 | {
42 | if (pb.Controls[0].GetType().Equals(typeof(HelloApps.GUI.CommandEditorClass)))
43 | {
44 | return (HelloApps.GUI.CommandEditorClass)pb.Controls[0];
45 | }
46 | else
47 | return null;
48 | }
49 | else
50 | return null;
51 | }
52 | else
53 | return null;
54 | }
55 | else
56 | return null;
57 | }
58 | else
59 | return null;
60 | }
61 | }
62 |
63 |
64 | public WebBrowser CurWebBrowser
65 | {
66 | get
67 | {
68 | if (this.SelectedIndex >= 0)
69 | {
70 | TabPage cur_page = this.TabPages[this.SelectedIndex];
71 |
72 | if (cur_page.Controls.Count == 1)
73 | {
74 | if (cur_page.Controls[0].GetType().Name.EndsWith("PictureBox"))
75 | {
76 | PictureBox pb = (PictureBox)cur_page.Controls[0];
77 | if (pb.Controls.Count == 1)
78 | {
79 | if (pb.Controls[0].GetType().Name.EndsWith("WebBrowser"))
80 | {
81 | return (WebBrowser)pb.Controls[0];
82 | }
83 | else
84 | return null;
85 | }
86 | else
87 | return null;
88 | }
89 | else
90 | return null;
91 | }
92 | else
93 | return null;
94 | }
95 | else
96 | return null;
97 | }
98 | }
99 |
100 |
101 |
102 | public PictureBox ChildPictureBox
103 | {
104 | get
105 | {
106 | if (this.SelectedIndex >= 0)
107 | {
108 | TabPage cur_page = this.TabPages[this.SelectedIndex];
109 |
110 | if (cur_page.Controls.Count == 1)
111 | {
112 | if (cur_page.Controls[0].GetType().Name.EndsWith("PictureBox"))
113 | {
114 | PictureBox pb = (PictureBox)cur_page.Controls[0];
115 | return pb;
116 | }
117 | else
118 | return null;
119 | }
120 | else
121 | return null;
122 | }
123 | else
124 | return null;
125 | }
126 | }
127 |
128 |
129 | public void RemoveCurrentTab()
130 | {
131 | if (this.SelectedIndex >= 0)
132 | {
133 | this.TabPages.RemoveAt(this.SelectedIndex);
134 | }
135 | }
136 |
137 | public string GetTabTitle(string filepath)
138 | {
139 | if (!string.IsNullOrEmpty(filepath))
140 | {
141 | string filename = Path.GetFileName(filepath);
142 |
143 | if (filename.Length > 33)
144 | {
145 | string prefix = filename.Substring(0, 10);
146 | string postfix = filename.Substring(filename.Length - 20, 20);
147 |
148 | return prefix + "..." + postfix;
149 | }
150 | return filename;
151 | }
152 | else
153 | return "untitled";
154 | }
155 | }
156 |
157 |
158 | internal class WebBrowserInfo
159 | {
160 | public WebBrowser wb = null;
161 | public string url = string.Empty;
162 |
163 | public WebBrowserInfo(WebBrowser p_wb, string p_url)
164 | {
165 | wb = p_wb;
166 | url = p_url;
167 | }
168 | }
169 |
170 | internal class AddWebBrowserItem
171 | {
172 | public string FileName = string.Empty;
173 | public string Title = string.Empty;
174 |
175 | public AddWebBrowserItem(string fileName, string title)
176 | {
177 | FileName = fileName;
178 | Title = title;
179 | }
180 | }
181 |
182 | }
183 |
--------------------------------------------------------------------------------
/Arduino.PLC/SPLHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Globalization;
6 |
7 | using System.IO;
8 | using System.IO.Ports;
9 | using System.Management;
10 | using System.Diagnostics;
11 |
12 |
13 | namespace HelloApps.Helper
14 | {
15 | public static class SPLDuinoHelper
16 | {
17 | public static string GetSPLDuinoComPortName()
18 | {
19 | string com_port = string.Empty;
20 |
21 | try
22 | {
23 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PnPEntity");
24 |
25 | foreach (ManagementObject queryObj in searcher.Get())
26 | {
27 | if (queryObj != null)
28 | {
29 | object q_obj = queryObj["Caption"];
30 |
31 | if (q_obj != null)
32 | {
33 | string caption_str = q_obj.ToString();
34 | if (!string.IsNullOrEmpty(caption_str))
35 | {
36 | if (caption_str.Contains("(COM"))
37 | {
38 | if (caption_str.Contains("Silicon") && caption_str.Contains("UART Bridge"))
39 | {
40 | int pos = caption_str.IndexOf("(COM");
41 | string desc = caption_str.Substring(pos + 1);
42 |
43 | desc = desc.Trim();
44 | desc = desc.TrimEnd(')');
45 |
46 | return desc;
47 | }
48 | }
49 | }
50 |
51 | }
52 | }
53 |
54 | }
55 | }
56 | catch
57 | {
58 |
59 | }
60 |
61 | return com_port;
62 | }
63 |
64 |
65 | public static List GetComPortNameList()
66 | {
67 | List com_port_list = new List();
68 |
69 | try
70 | {
71 | ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PnPEntity");
72 |
73 | foreach (ManagementObject queryObj in searcher.Get())
74 | {
75 | if (queryObj != null)
76 | {
77 | object q_obj = queryObj["Caption"];
78 |
79 | if (q_obj != null)
80 | {
81 | string caption_str = q_obj.ToString();
82 | string caption_str_lower = caption_str.ToLower();
83 |
84 | if (!string.IsNullOrEmpty(caption_str))
85 | {
86 | if (caption_str.Contains("(COM"))
87 | {
88 | int pos = caption_str.IndexOf("(COM");
89 | string port_name = caption_str.Substring(pos + 1);
90 |
91 | port_name = port_name.Trim();
92 | port_name = port_name.TrimEnd(')');
93 |
94 | if (caption_str.Contains("CH340"))
95 | port_name = port_name + " (SPL-Duino V2)";
96 | else if (caption_str.Contains("Silicon") && caption_str.Contains("UART Bridge"))
97 | port_name = port_name + " (SPL-Duino V1)";
98 | else if (caption_str_lower.Contains("bluetooth"))
99 | port_name = port_name + " (Bluetooth)";
100 |
101 | com_port_list.Add(port_name);
102 | }
103 | }
104 |
105 | }
106 | }
107 |
108 | }
109 | }
110 | catch
111 | {
112 |
113 | }
114 |
115 | return com_port_list;
116 | }
117 |
118 |
119 |
120 | public static List GetComPortList()
121 | {
122 | List com_port_list = new List();
123 |
124 | ManagementScope connectionScope = new ManagementScope();
125 | SelectQuery serialQuery = new SelectQuery("SELECT * FROM Win32_SerialPort");
126 | ManagementObjectSearcher searcher = new ManagementObjectSearcher(connectionScope, serialQuery);
127 |
128 | try
129 | {
130 | foreach (ManagementObject item in searcher.Get())
131 | {
132 | string desc = item["Description"].ToString();
133 | string deviceId = item["DeviceID"].ToString();
134 |
135 | if (desc.Contains("Silicon") && desc.Contains("UART Bridge"))
136 | {
137 | string com_port = deviceId;
138 | com_port_list.Add(com_port);
139 | }
140 |
141 |
142 | }
143 | }
144 | catch (ManagementException ex)
145 | {
146 | /* Do Nothing */
147 | }
148 |
149 | return com_port_list;
150 | }
151 | }
152 |
153 |
154 | }
155 |
156 |
157 |
--------------------------------------------------------------------------------
/Arduino.PLC/ScriptEditorMenu.txt:
--------------------------------------------------------------------------------
1 | importscript /filename:"ScriptEditorMenu_ActionCommand.txt"
2 | importscript /filename:"ScriptEditorMenu_Environment.txt"
--------------------------------------------------------------------------------
/Arduino.PLC/ScriptEditorMenu_ActionCommand.txt:
--------------------------------------------------------------------------------
1 | //################################
2 | inserttab /tabtext:"[0] Connections" /eng:"[0] Logic Commands"
3 | //################################
4 |
5 | addnode /name:"HLine" /text:"[0-1] Horizontal Line" /eng:"[0-1] HLine" /type:cmd /image:5 /forecolor:Crimson /tooltiptext:
6 |
7 | addnode /name:"VLine" /text:"[0-2] Vertical Line" /eng:"[0-2] VLine" /type:cmd /image:5 /forecolor:Crimson /tooltiptext:
8 |
--------------------------------------------------------------------------------
/Arduino.PLC/ScriptEditorMenu_Environment.txt:
--------------------------------------------------------------------------------
1 | //################################
2 | addtab /tabtext:"[1] PLC Commands" /eng:"[1] PLC Commands"
3 | //################################
4 |
5 |
6 | addrootnode /name:"[1-1] Input" /eng:"[1-1] Basic Commands" /type:cmd /forecolor:Black /tooltiptext:
7 |
8 |
9 | addchildnode /name:"InputA" /text:"[1-1-1] Input(A)" /eng:"[1-1-1] InputA" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
10 |
11 | addnode /name:"InputB" /text:"[1-1-2] Input(B)" /eng:"[1-1-2] InputB" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
12 |
13 | addnode /name:"MInputA" /text:"[1-1-3] MInput(A)" /eng:"[1-1-3] MInputA" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
14 |
15 | addnode /name:"MInputB" /text:"[1-1-4] MInput(B)" /eng:"[1-1-4] MInputB" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
16 |
17 | addnode /name:"TimerInputA" /text:"[1-1-5] TimerInput(A)" /eng:"[1-1-5] TimerInputA" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
18 |
19 | addnode /name:"TimerInputB" /text:"[1-1-6] TimerInput(B)" /eng:"[1-1-6] TimerInputB" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
20 |
21 | addnode /name:"CounterInputA" /text:"[1-1-7] CounterInput(A)" /eng:"[1-1-7] CounterInputA" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
22 |
23 | addnode /name:"CounterInputB" /text:"[1-1-8] CounterInput(B)" /eng:"[1-1-8] CounterInputB" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
24 |
25 |
26 |
27 | addrootnode /name:"" /type:cmd /forecolor:Black /tooltiptext:
28 | addrootnode /name:"[1-2] Output" /eng:"[1-2] Basic Functions" /type:cmd /forecolor:Black /tooltiptext:
29 |
30 |
31 | addchildnode /name:"Output" /text:"[1-2-1] Output" /eng:"[1-2-1] Output" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
32 |
33 | addnode /name:"MOutput" /text:"[1-2-2] MOutput" /eng:"[1-2-2] MOutput" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
34 |
35 | addnode /name:"TimerOutput" /text:"[1-2-3] TimerOutput" /eng:"[1-2-3] TimerOutput" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
36 |
37 | addnode /name:"CounterOutput" /text:"[1-2-4] CounterOutput" /eng:"[1-2-4] CounterOutput" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
38 |
39 | addnode /name:"SET" /text:"[1-2-5] SET" /eng:"[1-2-5] SET" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
40 |
41 | addnode /name:"RESET" /text:"[1-2-6] RESET" /eng:"[1-2-6] RESET" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
42 |
43 | addnode /name:"END" /text:"[1-2-7] END" /eng:"[1-2-7] END" /type:cmd /image:6 /forecolor:Crimson /tooltiptext:
44 |
--------------------------------------------------------------------------------
/Arduino.PLC/SketchViewForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace HelloApps
2 | {
3 | partial class SketchViewForm
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.textBox1 = new System.Windows.Forms.TextBox();
32 | this.button1 = new System.Windows.Forms.Button();
33 | this.SuspendLayout();
34 | //
35 | // textBox1
36 | //
37 | this.textBox1.Location = new System.Drawing.Point(25, 12);
38 | this.textBox1.Multiline = true;
39 | this.textBox1.Name = "textBox1";
40 | this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
41 | this.textBox1.Size = new System.Drawing.Size(618, 385);
42 | this.textBox1.TabIndex = 0;
43 | //
44 | // button1
45 | //
46 | this.button1.Location = new System.Drawing.Point(511, 418);
47 | this.button1.Name = "button1";
48 | this.button1.Size = new System.Drawing.Size(132, 32);
49 | this.button1.TabIndex = 2;
50 | this.button1.Text = "Close";
51 | this.button1.UseVisualStyleBackColor = true;
52 | this.button1.Click += new System.EventHandler(this.button1_Click);
53 | //
54 | // SketchViewForm
55 | //
56 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
57 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
58 | this.ClientSize = new System.Drawing.Size(672, 475);
59 | this.Controls.Add(this.button1);
60 | this.Controls.Add(this.textBox1);
61 | this.Name = "SketchViewForm";
62 | this.ShowIcon = false;
63 | this.ShowInTaskbar = false;
64 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
65 | this.Text = "View Sketch Code";
66 | this.ResumeLayout(false);
67 | this.PerformLayout();
68 |
69 | }
70 |
71 | #endregion
72 |
73 | private System.Windows.Forms.TextBox textBox1;
74 | private System.Windows.Forms.Button button1;
75 | }
76 | }
--------------------------------------------------------------------------------
/Arduino.PLC/SketchViewForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace HelloApps
10 | {
11 | public partial class SketchViewForm : Form
12 | {
13 | public SketchViewForm()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 |
19 | public void SetText(string lines)
20 | {
21 | textBox1.Text = lines;
22 | }
23 |
24 | private void button1_Click(object sender, EventArgs e)
25 | {
26 | Close();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Arduino.PLC/SketchViewForm.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Arduino.PLC/Sketch_Part1.txt:
--------------------------------------------------------------------------------
1 | #include
2 |
3 |
--------------------------------------------------------------------------------
/Arduino.PLC/Sketch_Part2.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | int main(void)
4 | {
5 | init();
6 |
7 | #if defined(USBCON)
8 | USB.attach();
9 | #endif
10 |
11 | setup();
12 | plc_setup();
13 |
14 | for (;;) {
15 | loop();
16 | plc_loop();
17 | if (serialEventRun)
18 | serialEventRun();
19 | }
20 |
21 | return 0;
22 | }
23 |
--------------------------------------------------------------------------------
/Arduino.PLC/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Debug/SPL.Duino.PLC.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Debug/SPL.Duino.PLC.vshost.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Debug/SPL.Duino.PLC.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/Arduino.PLC.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/bin/Release/Arduino.PLC.exe
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/Arduino.PLC.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/Arduino.PLC.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/bin/Release/Arduino.PLC.pdb
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/Arduino.PLC.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/bin/Release/Arduino.PLC.vshost.exe
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/Arduino.PLC.vshost.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/Arduino.PLC.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/SPL.Duino.PLC.vshost.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/SPL.Duino.PLC.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Arduino.PLC/bin/Release/stdole.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Arduino.PLC/bin/Release/stdole.dll
--------------------------------------------------------------------------------
/Images/arduino_plc1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Images/arduino_plc1.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Arduino PLC Copyright (C) 2019 HelloApps
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Arduino PLC Project
2 | GUI PLC Ladder Editor for Arduino Uno
3 |
4 | This project plan to include below features
5 |
6 | 1. GUI PLC Ladder Editor for Arduino Uno
7 | 1. Realtime monitoring through serial communication with Arduino
8 | 1. PLC simulator using Processing codes
9 |
10 |
11 | 
12 |
13 |
14 | ## GUI PLC Ladder Editor
15 | GUI PLC Ladder Editor includes belows features
16 |
17 | 1. Graphical GUI Editor
18 | 1. Arduino sketch code generator
19 | 1. Arduino Uno uploader
20 |
21 |
22 | ## Projects
23 | This project includes two sub projects
24 |
25 | * Arduino.PLC (C# Project)
26 | - This project folder includes C# project for PLC Ladder GUI Editor and Arduino uploader
27 |
28 | * PLC.Simulator (Processing Project)
29 | - This project folder includes Processing sketch codes for PLC simulation
30 |
31 | * Samples
32 | - This folder includes ladder sample scripts
33 |
34 | * Tutorials
35 | - This folder includes tutorial materials for ladder programming
36 |
37 |
38 | ## SW feature list
39 | This project includes below five features
40 |
41 | * Graphical ladder editor
42 |
43 | * Convert ladder script to arduino sketch code
44 |
45 | * Arduino sketch code upload
46 |
47 | * Arduino monitoring
48 |
49 | * PLC simulation using processing
50 |
51 |
52 | ## How to start (Install)
53 | 1. You can download C# source code or can run executable file within release link
54 | 1. In order to run PLC simulator, you should download Processing tool
55 | 1. Unzip release file and execute 'Arduino.PLC.exe' file
56 |
57 |
58 | ## Development tools and languages
59 | 1. Visual Studio and C# (.Net Framework 2.0)
60 | 1. Processing
61 |
62 | ## Hot to contribute
63 | 1. Contact through email
64 |
65 | ## Hot to develop
66 | 1. Install VS 2010 above for PLC ladder
67 | 1. Install Processing for simulation
68 |
69 | ## Code naming rule
70 | 1. We are using PascalCase .Net rule
71 | 1. All funtions and variables should be started capital letter
72 | 1. Global variables should be started '_' character
73 |
74 |
75 |
76 | ## License
77 | 1. GPL 3.0 See [License](LICENSE)
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/Simulation/Images/README.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Simulation/Images/bg_tile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/bg_tile.png
--------------------------------------------------------------------------------
/Simulation/Images/button_yellow_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/button_yellow_off.png
--------------------------------------------------------------------------------
/Simulation/Images/button_yellow_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/button_yellow_on.png
--------------------------------------------------------------------------------
/Simulation/Images/distance_inactive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/distance_inactive.png
--------------------------------------------------------------------------------
/Simulation/Images/fan_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/fan_off.png
--------------------------------------------------------------------------------
/Simulation/Images/fan_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/fan_on.png
--------------------------------------------------------------------------------
/Simulation/Images/light_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/light_off.png
--------------------------------------------------------------------------------
/Simulation/Images/light_on_blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/light_on_blue.png
--------------------------------------------------------------------------------
/Simulation/Images/light_on_green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/light_on_green.png
--------------------------------------------------------------------------------
/Simulation/Images/light_on_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/light_on_red.png
--------------------------------------------------------------------------------
/Simulation/Images/sensor_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/sensor_off.png
--------------------------------------------------------------------------------
/Simulation/Images/sensor_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/sensor_on.png
--------------------------------------------------------------------------------
/Simulation/Images/solenoid_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/solenoid_off.png
--------------------------------------------------------------------------------
/Simulation/Images/solenoid_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/solenoid_on.png
--------------------------------------------------------------------------------
/Simulation/Images/switch_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/switch_off.png
--------------------------------------------------------------------------------
/Simulation/Images/switch_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduinoIoTDev/ArduinoPLC/8615d3ba058437aecf15fd319d763068d0fab971/Simulation/Images/switch_on.png
--------------------------------------------------------------------------------
/Simulation/ProcessingScript:
--------------------------------------------------------------------------------
1 | import processing.serial.*;
2 |
3 | Serial myPort;
4 |
5 |
6 | PImage img_bg;
7 |
8 | PImage img_btn_on;
9 | PImage img_btn_off;
10 |
11 | PImage img_switch_on;
12 | PImage img_switch_off;
13 |
14 | PImage img_light_on;
15 | PImage img_light_off;
16 |
17 |
18 | int btn_size = 200;
19 |
20 | boolean[] switch_press_list = new boolean[10];
21 |
22 | int btn_pressed = 0;
23 | int switch_on = 1;
24 | int switch_pressed = 0;
25 | int light_on = 0;
26 |
27 |
28 | void setup()
29 | {
30 | size(1200, 800);
31 |
32 | for (int i = 0; i < 10; i++)
33 | {
34 | switch_press_list[i] = false;
35 | }
36 |
37 | img_bg = loadImage("../images/bg_tile.png");
38 | img_btn_on = loadImage("../images/button_yellow_on.png");
39 | img_btn_off = loadImage("../images/button_yellow_off.png");
40 |
41 | img_switch_on = loadImage("../images/switch_on.png");
42 | img_switch_off = loadImage("../images/switch_off.png");
43 |
44 | img_light_on = loadImage("../images/light_on_blue.png");
45 | img_light_off = loadImage("../images/light_off.png");
46 |
47 |
48 | if (Serial.list() != null && Serial.list().length > 0)
49 | {
50 | println(Serial.list());
51 | myPort = new Serial(this, Serial.list()[0], 115200);
52 | }
53 | }
54 |
55 |
56 | long start_time = 0;
57 | long end_time = 0;
58 |
59 | String recv_str = "";
60 | String remained_str = "";
61 | String tocken_str = "";
62 |
63 | long send_chk_cnt = 0;
64 |
65 | void draw()
66 | {
67 |
68 | send_chk_cnt++;
69 |
70 | if ((send_chk_cnt % 50) == 0)
71 | myPort.write("[SIM_ON]");
72 |
73 |
74 | while (myPort != null && myPort.available() > 0)
75 | {
76 | String inBuffer = myPort.readString();
77 |
78 | recv_str = recv_str + inBuffer;
79 |
80 | for (int i = 0; i < recv_str.length(); i++)
81 | {
82 | if (recv_str.charAt(i) == '[')
83 | {
84 | tocken_str = "";
85 | }
86 | else if (recv_str.charAt(i) == ']')
87 | {
88 |
89 | if (tocken_str.equals("P00040=1"))
90 | {
91 | light_on = 1;
92 | }
93 | else if (tocken_str.equals("P00040=0"))
94 | {
95 | light_on = 0;
96 | }
97 |
98 |
99 | if (i < (recv_str.length() - 1))
100 | remained_str = recv_str.substring(i + 1);
101 | else
102 | remained_str = "";
103 |
104 | tocken_str = "";
105 | }
106 | else
107 | tocken_str = tocken_str + recv_str.charAt(i);
108 | }
109 |
110 | recv_str = remained_str;
111 |
112 |
113 | }
114 |
115 |
116 |
117 | draw_bg();
118 |
119 |
120 | if (click_check_btn(50, 50))
121 | {
122 | draw_btn_on(50, 50);
123 |
124 | if (btn_pressed == 0)
125 | {
126 | myPort.write("[P00000=1]");
127 | }
128 |
129 | btn_pressed = 1;
130 | }
131 | else
132 | {
133 | draw_btn_off(50, 50);
134 |
135 | if (btn_pressed == 1)
136 | {
137 | myPort.write("[P00000=0]");
138 | }
139 |
140 | btn_pressed = 0;
141 | }
142 |
143 |
144 |
145 | //Switch
146 | if (click_check_btn(50, 300))
147 | {
148 | if (switch_pressed == 0)
149 | {
150 | if (switch_on == 1)
151 | {
152 | switch_on = 0;
153 | myPort.write("[P00001=0]");
154 | }
155 | else
156 | {
157 | switch_on = 1;
158 | myPort.write("[P00001=1]");
159 | }
160 | }
161 |
162 | switch_pressed = 1;
163 | }
164 | else
165 | {
166 | switch_pressed = 0;
167 | }
168 |
169 | if (switch_on == 1)
170 | {
171 | draw_switch_on(50, 300);
172 | }
173 | else
174 | {
175 | draw_switch_off(50, 300);
176 | }
177 |
178 |
179 |
180 | //Light
181 | if (light_on == 1)
182 | {
183 | draw_light_on(300, 50);
184 | }
185 | else
186 | {
187 | draw_light_off(300, 50);
188 | }
189 |
190 | }
191 |
192 | void draw_bg()
193 | {
194 | for (int y = 0; y < 2; y++)
195 | {
196 | for (int x = 0; x < 3; x++)
197 | {
198 | image(img_bg, x * 400, y * 400, 400, 400);
199 | }
200 | }
201 | }
202 |
203 | boolean click_check_btn(int x, int y)
204 | {
205 | boolean res = false;
206 |
207 | if (mousePressed)
208 | {
209 | if (mouseX >= x && mouseX <= (x + btn_size) && mouseY >= y && mouseY <= (y + btn_size))
210 | res = true;
211 | }
212 |
213 | return res;
214 | }
215 |
216 | void draw_btn_on(int x, int y)
217 | {
218 | image(img_btn_on, x, y, btn_size, btn_size);
219 | }
220 |
221 | void draw_btn_off(int x, int y)
222 | {
223 | image(img_btn_off, x, y, btn_size, btn_size);
224 | }
225 |
226 |
227 | void draw_switch_on(int x, int y)
228 | {
229 | image(img_switch_on, x, y, btn_size, btn_size);
230 | }
231 |
232 | void draw_switch_off(int x, int y)
233 | {
234 | image(img_switch_off, x, y, btn_size, btn_size);
235 | }
236 |
237 |
238 |
239 | void draw_light_on(int x, int y)
240 | {
241 | image(img_light_on, x, y, btn_size, btn_size);
242 | }
243 |
244 | void draw_light_off(int x, int y)
245 | {
246 | image(img_light_off, x, y, btn_size, btn_size);
247 | }
248 |
--------------------------------------------------------------------------------
/Simulation/README.md:
--------------------------------------------------------------------------------
1 | Please download processing from processing.org
2 |
--------------------------------------------------------------------------------