Added log and macro builder

master
Aaron Johnson 5 years ago
parent 74c238b472
commit 876f3f06cb

@ -41,12 +41,20 @@
this.lbl_instructions = new System.Windows.Forms.Label(); this.lbl_instructions = new System.Windows.Forms.Label();
this.lbl_version = new System.Windows.Forms.Label(); this.lbl_version = new System.Windows.Forms.Label();
this.gbox_pipmgmt = new System.Windows.Forms.GroupBox(); this.gbox_pipmgmt = new System.Windows.Forms.GroupBox();
this.cbox_showLog = new System.Windows.Forms.CheckBox();
this.gbox_log = new System.Windows.Forms.GroupBox();
this.lst_log = new System.Windows.Forms.ListBox();
this.txt_mba = new System.Windows.Forms.TextBox();
this.gbox_macroBuilder = new System.Windows.Forms.GroupBox();
this.gbox_pipmgmt.SuspendLayout();
this.gbox_log.SuspendLayout();
this.gbox_macroBuilder.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// prog_eng // prog_eng
// //
this.prog_eng.BackColor = System.Drawing.SystemColors.ControlDarkDark; this.prog_eng.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.prog_eng.Location = new System.Drawing.Point(117, 27); this.prog_eng.Location = new System.Drawing.Point(117, 33);
this.prog_eng.Maximum = 8; this.prog_eng.Maximum = 8;
this.prog_eng.Name = "prog_eng"; this.prog_eng.Name = "prog_eng";
this.prog_eng.Size = new System.Drawing.Size(158, 23); this.prog_eng.Size = new System.Drawing.Size(158, 23);
@ -56,7 +64,7 @@
// prog_sys // prog_sys
// //
this.prog_sys.BackColor = System.Drawing.SystemColors.ControlDarkDark; this.prog_sys.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.prog_sys.Location = new System.Drawing.Point(12, 76); this.prog_sys.Location = new System.Drawing.Point(12, 82);
this.prog_sys.Maximum = 8; this.prog_sys.Maximum = 8;
this.prog_sys.Name = "prog_sys"; this.prog_sys.Name = "prog_sys";
this.prog_sys.Size = new System.Drawing.Size(158, 23); this.prog_sys.Size = new System.Drawing.Size(158, 23);
@ -66,7 +74,7 @@
// prog_wep // prog_wep
// //
this.prog_wep.BackColor = System.Drawing.SystemColors.ControlDarkDark; this.prog_wep.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.prog_wep.Location = new System.Drawing.Point(222, 76); this.prog_wep.Location = new System.Drawing.Point(222, 82);
this.prog_wep.Maximum = 8; this.prog_wep.Maximum = 8;
this.prog_wep.Name = "prog_wep"; this.prog_wep.Name = "prog_wep";
this.prog_wep.Size = new System.Drawing.Size(158, 23); this.prog_wep.Size = new System.Drawing.Size(158, 23);
@ -75,9 +83,8 @@
// //
// lbl_eng // lbl_eng
// //
this.lbl_eng.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.lbl_eng.AutoSize = true; this.lbl_eng.AutoSize = true;
this.lbl_eng.Location = new System.Drawing.Point(181, 53); this.lbl_eng.Location = new System.Drawing.Point(181, 59);
this.lbl_eng.Name = "lbl_eng"; this.lbl_eng.Name = "lbl_eng";
this.lbl_eng.Size = new System.Drawing.Size(30, 13); this.lbl_eng.Size = new System.Drawing.Size(30, 13);
this.lbl_eng.TabIndex = 3; this.lbl_eng.TabIndex = 3;
@ -86,7 +93,7 @@
// lbl_sys // lbl_sys
// //
this.lbl_sys.AutoSize = true; this.lbl_sys.AutoSize = true;
this.lbl_sys.Location = new System.Drawing.Point(76, 102); this.lbl_sys.Location = new System.Drawing.Point(76, 108);
this.lbl_sys.Name = "lbl_sys"; this.lbl_sys.Name = "lbl_sys";
this.lbl_sys.Size = new System.Drawing.Size(28, 13); this.lbl_sys.Size = new System.Drawing.Size(28, 13);
this.lbl_sys.TabIndex = 4; this.lbl_sys.TabIndex = 4;
@ -95,7 +102,7 @@
// lbl_wep // lbl_wep
// //
this.lbl_wep.AutoSize = true; this.lbl_wep.AutoSize = true;
this.lbl_wep.Location = new System.Drawing.Point(283, 102); this.lbl_wep.Location = new System.Drawing.Point(283, 108);
this.lbl_wep.Name = "lbl_wep"; this.lbl_wep.Name = "lbl_wep";
this.lbl_wep.Size = new System.Drawing.Size(32, 13); this.lbl_wep.Size = new System.Drawing.Size(32, 13);
this.lbl_wep.TabIndex = 5; this.lbl_wep.TabIndex = 5;
@ -103,7 +110,7 @@
// //
// btn_reset // btn_reset
// //
this.btn_reset.Location = new System.Drawing.Point(133, 120); this.btn_reset.Location = new System.Drawing.Point(133, 126);
this.btn_reset.Name = "btn_reset"; this.btn_reset.Name = "btn_reset";
this.btn_reset.Size = new System.Drawing.Size(126, 31); this.btn_reset.Size = new System.Drawing.Size(126, 31);
this.btn_reset.TabIndex = 6; this.btn_reset.TabIndex = 6;
@ -137,7 +144,7 @@
// //
this.lbl_instructions.AutoSize = true; this.lbl_instructions.AutoSize = true;
this.lbl_instructions.ForeColor = System.Drawing.SystemColors.ControlDarkDark; this.lbl_instructions.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.lbl_instructions.Location = new System.Drawing.Point(98, 161); this.lbl_instructions.Location = new System.Drawing.Point(95, 12);
this.lbl_instructions.Name = "lbl_instructions"; this.lbl_instructions.Name = "lbl_instructions";
this.lbl_instructions.Size = new System.Drawing.Size(196, 13); this.lbl_instructions.Size = new System.Drawing.Size(196, 13);
this.lbl_instructions.TabIndex = 10; this.lbl_instructions.TabIndex = 10;
@ -152,10 +159,12 @@
this.lbl_version.Name = "lbl_version"; this.lbl_version.Name = "lbl_version";
this.lbl_version.Size = new System.Drawing.Size(46, 13); this.lbl_version.Size = new System.Drawing.Size(46, 13);
this.lbl_version.TabIndex = 11; this.lbl_version.TabIndex = 11;
this.lbl_version.Text = "v1.0.0.2"; this.lbl_version.Text = "v1.0.1.1";
// //
// gbox_pipmgmt // gbox_pipmgmt
// //
this.gbox_pipmgmt.Controls.Add(this.cbox_showLog);
this.gbox_pipmgmt.Controls.Add(this.lbl_instructions);
this.gbox_pipmgmt.ForeColor = System.Drawing.SystemColors.ControlText; this.gbox_pipmgmt.ForeColor = System.Drawing.SystemColors.ControlText;
this.gbox_pipmgmt.Location = new System.Drawing.Point(3, 3); this.gbox_pipmgmt.Location = new System.Drawing.Point(3, 3);
this.gbox_pipmgmt.Name = "gbox_pipmgmt"; this.gbox_pipmgmt.Name = "gbox_pipmgmt";
@ -164,13 +173,71 @@
this.gbox_pipmgmt.TabStop = false; this.gbox_pipmgmt.TabStop = false;
this.gbox_pipmgmt.Text = "Power Distribution"; this.gbox_pipmgmt.Text = "Power Distribution";
// //
// cbox_showLog
//
this.cbox_showLog.AutoSize = true;
this.cbox_showLog.Location = new System.Drawing.Point(7, 159);
this.cbox_showLog.Name = "cbox_showLog";
this.cbox_showLog.Size = new System.Drawing.Size(139, 17);
this.cbox_showLog.TabIndex = 11;
this.cbox_showLog.Text = "Show Log/Macro Assist";
this.cbox_showLog.UseVisualStyleBackColor = true;
this.cbox_showLog.CheckedChanged += new System.EventHandler(this.cbox_showLog_CheckedChanged);
//
// gbox_log
//
this.gbox_log.Controls.Add(this.lst_log);
this.gbox_log.Location = new System.Drawing.Point(396, 3);
this.gbox_log.Name = "gbox_log";
this.gbox_log.Size = new System.Drawing.Size(385, 204);
this.gbox_log.TabIndex = 13;
this.gbox_log.TabStop = false;
this.gbox_log.Text = "Distribution Log";
this.gbox_log.Visible = false;
//
// lst_log
//
this.lst_log.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lst_log.BackColor = System.Drawing.SystemColors.Window;
this.lst_log.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lst_log.ForeColor = System.Drawing.SystemColors.MenuText;
this.lst_log.FormattingEnabled = true;
this.lst_log.Items.AddRange(new object[] {
"[ RST ]\t\t[ 2 / 2 / 2 ]"});
this.lst_log.Location = new System.Drawing.Point(5, 14);
this.lst_log.Name = "lst_log";
this.lst_log.Size = new System.Drawing.Size(376, 184);
this.lst_log.TabIndex = 0;
this.lst_log.Visible = false;
//
// txt_mba
//
this.txt_mba.Location = new System.Drawing.Point(5, 20);
this.txt_mba.Name = "txt_mba";
this.txt_mba.Size = new System.Drawing.Size(768, 20);
this.txt_mba.TabIndex = 14;
this.txt_mba.Text = "{down}";
this.txt_mba.Visible = false;
//
// gbox_macroBuilder
//
this.gbox_macroBuilder.Controls.Add(this.txt_mba);
this.gbox_macroBuilder.Location = new System.Drawing.Point(3, 205);
this.gbox_macroBuilder.Name = "gbox_macroBuilder";
this.gbox_macroBuilder.Size = new System.Drawing.Size(778, 50);
this.gbox_macroBuilder.TabIndex = 14;
this.gbox_macroBuilder.TabStop = false;
this.gbox_macroBuilder.Text = "Macro Build Assist";
this.gbox_macroBuilder.Visible = false;
//
// form_main // form_main
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(392, 210); this.ClientSize = new System.Drawing.Size(392, 209);
this.Controls.Add(this.gbox_macroBuilder);
this.Controls.Add(this.gbox_log);
this.Controls.Add(this.lbl_version); this.Controls.Add(this.lbl_version);
this.Controls.Add(this.lbl_instructions);
this.Controls.Add(this.lbl_xant_ad); this.Controls.Add(this.lbl_xant_ad);
this.Controls.Add(this.lbl_copyright); this.Controls.Add(this.lbl_copyright);
this.Controls.Add(this.btn_reset); this.Controls.Add(this.btn_reset);
@ -185,6 +252,11 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "form_main"; this.Name = "form_main";
this.Text = "Elite Power Management Simulator"; this.Text = "Elite Power Management Simulator";
this.gbox_pipmgmt.ResumeLayout(false);
this.gbox_pipmgmt.PerformLayout();
this.gbox_log.ResumeLayout(false);
this.gbox_macroBuilder.ResumeLayout(false);
this.gbox_macroBuilder.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -204,6 +276,11 @@
private System.Windows.Forms.Label lbl_instructions; private System.Windows.Forms.Label lbl_instructions;
private System.Windows.Forms.Label lbl_version; private System.Windows.Forms.Label lbl_version;
private System.Windows.Forms.GroupBox gbox_pipmgmt; private System.Windows.Forms.GroupBox gbox_pipmgmt;
private System.Windows.Forms.CheckBox cbox_showLog;
private System.Windows.Forms.GroupBox gbox_log;
private System.Windows.Forms.ListBox lst_log;
private System.Windows.Forms.TextBox txt_mba;
private System.Windows.Forms.GroupBox gbox_macroBuilder;
} }
} }

@ -1,4 +1,5 @@
using System; using elite_power_sim;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
@ -22,6 +23,13 @@ namespace Elite_Power_Management_Simulator
public static Int16 eng = 4; public static Int16 eng = 4;
public static Int16 sys = 4; public static Int16 sys = 4;
public static Int16 wep = 4; public static Int16 wep = 4;
public static string key_rst = "{down}";
public static string key_sys = "{left}";
public static string key_eng = "{up}";
public static string key_wep = "{right}";
public static string rst_text = "[ RST ]\t\t[ 2 / 2 / 2 ]";
} }
public static class calc public static class calc
@ -40,16 +48,36 @@ namespace Elite_Power_Management_Simulator
prog_wep.Value = global.wep; prog_wep.Value = global.wep;
} }
//Distribution History Tracking
public void track_history(string log_item, string log_btn)
{
string q = log_item;
string eng = Convert.ToString(Convert.ToDecimal(global.eng)/2);
string sys = Convert.ToString(Convert.ToDecimal(global.sys)/2);
string wep = Convert.ToString(Convert.ToDecimal(global.wep)/2);
lst_log.Items.Add(q + "\t\t" + "[ " + sys + " / " + eng + " / " + wep + " ]");
txt_mba.Text = txt_mba.Text + log_btn;
}
public void reset_history()
{
lst_log.Items.Clear();
lst_log.Items.Add(global.rst_text);
txt_mba.Text = "{down}";
}
//Power Distribution Functions //Power Distribution Functions
public void pwr_reset() public void pwr_reset()
{ {
global.eng = 4; global.eng = 4;
global.sys = 4; global.sys = 4;
global.wep = 4; global.wep = 4;
reset_history();
update(); update();
} }
public void pwr_eng() public void pwr_eng()
{ {
string log_iname = "+ENG";
bool fin = false; bool fin = false;
if (global.eng < 8) if (global.eng < 8)
{ {
@ -120,10 +148,12 @@ namespace Elite_Power_Management_Simulator
} }
} }
track_history(log_iname, global.key_eng);
update(); update();
} }
public void pwr_sys() public void pwr_sys()
{ {
string log_iname = "+SYS";
bool fin = false; bool fin = false;
if (global.sys < 8) if (global.sys < 8)
{ {
@ -180,10 +210,12 @@ namespace Elite_Power_Management_Simulator
} }
} }
track_history(log_iname, global.key_sys);
update(); update();
} }
public void pwr_wep() public void pwr_wep()
{ {
string log_iname = "+WEP";
bool fin = false; bool fin = false;
if (global.wep < 8) if (global.wep < 8)
{ {
@ -240,6 +272,7 @@ namespace Elite_Power_Management_Simulator
} }
} }
track_history(log_iname, global.key_wep);
update(); update();
} }
@ -272,5 +305,28 @@ namespace Elite_Power_Management_Simulator
{ {
lbl_xant_ad.Visible = true; lbl_xant_ad.Visible = true;
} }
private void cbox_showLog_CheckedChanged(object sender, EventArgs e)
{
//Default size: 408, 248
if (!cbox_showLog.Checked)
{
this.Width = 408;
this.Height = 248;
lst_log.Hide();
txt_mba.Hide();
gbox_log.Hide();
gbox_macroBuilder.Hide();
}
else
{
this.Width = 800;
this.Height = 296;
lst_log.Show();
txt_mba.Show();
gbox_log.Show();
gbox_macroBuilder.Show();
}
}
} }
} }

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.2")] [assembly: AssemblyVersion("1.0.1.1")]
[assembly: AssemblyFileVersion("1.0.0.2")] [assembly: AssemblyFileVersion("1.0.1.1")]

Loading…
Cancel
Save