mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 19:05:39 +02:00
Current mission displayed at panel
This commit is contained in:
@@ -118,6 +118,11 @@ public class DatabaseController
|
|||||||
SQLQueryTxt += "INSERT INTO `pe_OnlineStatus` (`pe_OnlineStatus_instance`) SELECT '" + Int32.Parse(TCPFrameInstance) + "' FROM DUAL WHERE NOT EXISTS(SELECT * FROM `pe_OnlineStatus` WHERE `pe_OnlineStatus_instance` = '" + Int32.Parse(TCPFrameInstance) + "');";
|
SQLQueryTxt += "INSERT INTO `pe_OnlineStatus` (`pe_OnlineStatus_instance`) SELECT '" + Int32.Parse(TCPFrameInstance) + "' FROM DUAL WHERE NOT EXISTS(SELECT * FROM `pe_OnlineStatus` WHERE `pe_OnlineStatus_instance` = '" + Int32.Parse(TCPFrameInstance) + "');";
|
||||||
SQLQueryTxt += "UPDATE `pe_OnlineStatus` SET `pe_OnlineStatus_theatre` = '" + TCPFrame.payload.mission.theatre + "', `pe_OnlineStatus_name` = '" + TCPFrame.payload.mission.name + "' , `pe_OnlineStatus_pause` = '" + TCPFrame.payload.mission.pause + "', `pe_OnlineStatus_multiplayer` = '" + TCPFrame.payload.mission.multiplayer + "', `pe_OnlineStatus_realtime` = '" + TCPFrame.payload.mission.realtime + "', `pe_OnlineStatus_modeltime` = '" + TCPFrame.payload.mission.modeltime + "', `pe_OnlineStatus_players` = " + player_count + " WHERE `pe_OnlineStatus_instance` = '" + Int32.Parse(TCPFrameInstance) + "';";
|
SQLQueryTxt += "UPDATE `pe_OnlineStatus` SET `pe_OnlineStatus_theatre` = '" + TCPFrame.payload.mission.theatre + "', `pe_OnlineStatus_name` = '" + TCPFrame.payload.mission.name + "' , `pe_OnlineStatus_pause` = '" + TCPFrame.payload.mission.pause + "', `pe_OnlineStatus_multiplayer` = '" + TCPFrame.payload.mission.multiplayer + "', `pe_OnlineStatus_realtime` = '" + TCPFrame.payload.mission.realtime + "', `pe_OnlineStatus_modeltime` = '" + TCPFrame.payload.mission.modeltime + "', `pe_OnlineStatus_players` = " + player_count + " WHERE `pe_OnlineStatus_instance` = '" + Int32.Parse(TCPFrameInstance) + "';";
|
||||||
|
|
||||||
|
// Save for GUI
|
||||||
|
Globals.CurrentMission.Theatre = TCPFrame.payload.mission.theatre;
|
||||||
|
Globals.CurrentMission.Mission = TCPFrame.payload.mission.name;
|
||||||
|
Globals.CurrentMission.Pause = TCPFrame.payload.mission.pause;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
// This class gathers all global variable
|
// This class gathers all global variable
|
||||||
|
|
||||||
|
// Class to hold current game state/mission information
|
||||||
|
class CurrentMissionClass
|
||||||
|
{
|
||||||
|
|
||||||
|
public string Theatre = "";
|
||||||
|
public string Mission = "";
|
||||||
|
public string Pause = "";
|
||||||
|
|
||||||
|
public string ToInfoString()
|
||||||
|
{
|
||||||
|
return this.Mission + " (" + this.Theatre + ") Pause:" + this.Pause;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal class Globals
|
internal class Globals
|
||||||
{
|
{
|
||||||
public static string[] AppLogHistory = new string[10]; // Log history for GUI
|
public static string[] AppLogHistory = new string[10]; // Log history for GUI
|
||||||
@@ -22,5 +36,6 @@ internal class Globals
|
|||||||
public static string VersionDCSHook = ""; // Version - DCS hook
|
public static string VersionDCSHook = ""; // Version - DCS hook
|
||||||
public static string VersionDatabase = ""; // Version - Database
|
public static string VersionDatabase = ""; // Version - Database
|
||||||
public static string VersionPerun = "DEBUG"; // Version - Perun
|
public static string VersionPerun = "DEBUG"; // Version - Perun
|
||||||
|
public static CurrentMissionClass CurrentMission = new CurrentMissionClass(); // Mission - name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
this.TIM_Autostart = new System.Windows.Forms.Timer(this.components);
|
this.TIM_Autostart = new System.Windows.Forms.Timer(this.components);
|
||||||
this.con_check_minimize_to_tray = new System.Windows.Forms.CheckBox();
|
this.con_check_minimize_to_tray = new System.Windows.Forms.CheckBox();
|
||||||
this.con_GroupBox_4 = new System.Windows.Forms.GroupBox();
|
this.con_GroupBox_4 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.label16 = new System.Windows.Forms.Label();
|
||||||
this.con_Button_Reset_Flags = new System.Windows.Forms.Button();
|
this.con_Button_Reset_Flags = new System.Windows.Forms.Button();
|
||||||
this.label12 = new System.Windows.Forms.Label();
|
this.label12 = new System.Windows.Forms.Label();
|
||||||
this.label11 = new System.Windows.Forms.Label();
|
this.label11 = new System.Windows.Forms.Label();
|
||||||
@@ -104,7 +105,7 @@
|
|||||||
"Not connected"});
|
"Not connected"});
|
||||||
this.con_List_Received.Location = new System.Drawing.Point(8, 44);
|
this.con_List_Received.Location = new System.Drawing.Point(8, 44);
|
||||||
this.con_List_Received.Name = "con_List_Received";
|
this.con_List_Received.Name = "con_List_Received";
|
||||||
this.con_List_Received.Size = new System.Drawing.Size(307, 160);
|
this.con_List_Received.Size = new System.Drawing.Size(307, 121);
|
||||||
this.con_List_Received.TabIndex = 0;
|
this.con_List_Received.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// con_Button_Listen_ON
|
// con_Button_Listen_ON
|
||||||
@@ -134,9 +135,9 @@
|
|||||||
this.con_GroupBox_1.Controls.Add(this.con_com_loglevel);
|
this.con_GroupBox_1.Controls.Add(this.con_com_loglevel);
|
||||||
this.con_GroupBox_1.Controls.Add(this.con_List_Received);
|
this.con_GroupBox_1.Controls.Add(this.con_List_Received);
|
||||||
this.con_GroupBox_1.Controls.Add(this.con_Button_Add_Marker);
|
this.con_GroupBox_1.Controls.Add(this.con_Button_Add_Marker);
|
||||||
this.con_GroupBox_1.Location = new System.Drawing.Point(344, 147);
|
this.con_GroupBox_1.Location = new System.Drawing.Point(344, 177);
|
||||||
this.con_GroupBox_1.Name = "con_GroupBox_1";
|
this.con_GroupBox_1.Name = "con_GroupBox_1";
|
||||||
this.con_GroupBox_1.Size = new System.Drawing.Size(324, 209);
|
this.con_GroupBox_1.Size = new System.Drawing.Size(324, 179);
|
||||||
this.con_GroupBox_1.TabIndex = 4;
|
this.con_GroupBox_1.TabIndex = 4;
|
||||||
this.con_GroupBox_1.TabStop = false;
|
this.con_GroupBox_1.TabStop = false;
|
||||||
this.con_GroupBox_1.Text = "Data log";
|
this.con_GroupBox_1.Text = "Data log";
|
||||||
@@ -146,7 +147,7 @@
|
|||||||
this.label15.AutoSize = true;
|
this.label15.AutoSize = true;
|
||||||
this.label15.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
this.label15.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
this.label15.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.label15.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.label15.Location = new System.Drawing.Point(9, 21);
|
this.label15.Location = new System.Drawing.Point(6, 18);
|
||||||
this.label15.Name = "label15";
|
this.label15.Name = "label15";
|
||||||
this.label15.Size = new System.Drawing.Size(50, 13);
|
this.label15.Size = new System.Drawing.Size(50, 13);
|
||||||
this.label15.TabIndex = 22;
|
this.label15.TabIndex = 22;
|
||||||
@@ -162,7 +163,7 @@
|
|||||||
"Warning",
|
"Warning",
|
||||||
"Info",
|
"Info",
|
||||||
"Debug"});
|
"Debug"});
|
||||||
this.con_com_loglevel.Location = new System.Drawing.Point(65, 18);
|
this.con_com_loglevel.Location = new System.Drawing.Point(62, 12);
|
||||||
this.con_com_loglevel.Name = "con_com_loglevel";
|
this.con_com_loglevel.Name = "con_com_loglevel";
|
||||||
this.con_com_loglevel.Size = new System.Drawing.Size(102, 20);
|
this.con_com_loglevel.Size = new System.Drawing.Size(102, 20);
|
||||||
this.con_com_loglevel.TabIndex = 23;
|
this.con_com_loglevel.TabIndex = 23;
|
||||||
@@ -172,7 +173,7 @@
|
|||||||
//
|
//
|
||||||
this.con_Button_Add_Marker.Enabled = false;
|
this.con_Button_Add_Marker.Enabled = false;
|
||||||
this.con_Button_Add_Marker.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.con_Button_Add_Marker.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.con_Button_Add_Marker.Location = new System.Drawing.Point(229, 17);
|
this.con_Button_Add_Marker.Location = new System.Drawing.Point(232, 12);
|
||||||
this.con_Button_Add_Marker.Name = "con_Button_Add_Marker";
|
this.con_Button_Add_Marker.Name = "con_Button_Add_Marker";
|
||||||
this.con_Button_Add_Marker.Size = new System.Drawing.Size(86, 20);
|
this.con_Button_Add_Marker.Size = new System.Drawing.Size(86, 20);
|
||||||
this.con_Button_Add_Marker.TabIndex = 21;
|
this.con_Button_Add_Marker.TabIndex = 21;
|
||||||
@@ -490,6 +491,7 @@
|
|||||||
//
|
//
|
||||||
// con_GroupBox_4
|
// con_GroupBox_4
|
||||||
//
|
//
|
||||||
|
this.con_GroupBox_4.Controls.Add(this.label16);
|
||||||
this.con_GroupBox_4.Controls.Add(this.con_Button_Reset_Flags);
|
this.con_GroupBox_4.Controls.Add(this.con_Button_Reset_Flags);
|
||||||
this.con_GroupBox_4.Controls.Add(this.label12);
|
this.con_GroupBox_4.Controls.Add(this.label12);
|
||||||
this.con_GroupBox_4.Controls.Add(this.label11);
|
this.con_GroupBox_4.Controls.Add(this.label11);
|
||||||
@@ -501,11 +503,22 @@
|
|||||||
this.con_GroupBox_4.Controls.Add(this.con_img_db);
|
this.con_GroupBox_4.Controls.Add(this.con_img_db);
|
||||||
this.con_GroupBox_4.Location = new System.Drawing.Point(344, 54);
|
this.con_GroupBox_4.Location = new System.Drawing.Point(344, 54);
|
||||||
this.con_GroupBox_4.Name = "con_GroupBox_4";
|
this.con_GroupBox_4.Name = "con_GroupBox_4";
|
||||||
this.con_GroupBox_4.Size = new System.Drawing.Size(324, 87);
|
this.con_GroupBox_4.Size = new System.Drawing.Size(324, 117);
|
||||||
this.con_GroupBox_4.TabIndex = 25;
|
this.con_GroupBox_4.TabIndex = 25;
|
||||||
this.con_GroupBox_4.TabStop = false;
|
this.con_GroupBox_4.TabStop = false;
|
||||||
this.con_GroupBox_4.Text = "Status";
|
this.con_GroupBox_4.Text = "Status";
|
||||||
//
|
//
|
||||||
|
// label16
|
||||||
|
//
|
||||||
|
this.label16.AutoSize = true;
|
||||||
|
this.label16.Location = new System.Drawing.Point(6, 78);
|
||||||
|
this.label16.Name = "label16";
|
||||||
|
this.label16.Size = new System.Drawing.Size(76, 13);
|
||||||
|
this.label16.TabIndex = 27;
|
||||||
|
this.label16.Text = "[mission name]";
|
||||||
|
this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
|
this.label16.Click += new System.EventHandler(this.label16_Click);
|
||||||
|
//
|
||||||
// con_Button_Reset_Flags
|
// con_Button_Reset_Flags
|
||||||
//
|
//
|
||||||
this.con_Button_Reset_Flags.Enabled = false;
|
this.con_Button_Reset_Flags.Enabled = false;
|
||||||
@@ -712,6 +725,7 @@
|
|||||||
private System.Windows.Forms.PictureBox con_img_dcs;
|
private System.Windows.Forms.PictureBox con_img_dcs;
|
||||||
private System.Windows.Forms.PictureBox con_img_db;
|
private System.Windows.Forms.PictureBox con_img_db;
|
||||||
private System.Windows.Forms.GroupBox con_GroupBox_5;
|
private System.Windows.Forms.GroupBox con_GroupBox_5;
|
||||||
|
private System.Windows.Forms.Label label16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ namespace Perun_v1
|
|||||||
con_img_lotATC.Image = (Image)Properties.Resources.ResourceManager.GetObject("status_disconnected");
|
con_img_lotATC.Image = (Image)Properties.Resources.ResourceManager.GetObject("status_disconnected");
|
||||||
con_img_srs.Image = (Image)Properties.Resources.ResourceManager.GetObject("status_disconnected");
|
con_img_srs.Image = (Image)Properties.Resources.ResourceManager.GetObject("status_disconnected");
|
||||||
|
|
||||||
|
this.form_Main_SetControlsInit();
|
||||||
|
|
||||||
// Display information that we are runing debug build
|
// Display information that we are runing debug build
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
|
|
||||||
@@ -201,8 +203,14 @@ namespace Perun_v1
|
|||||||
con_txt_dcs_instance.Enabled = true;
|
con_txt_dcs_instance.Enabled = true;
|
||||||
con_com_loglevel.Enabled = true;
|
con_com_loglevel.Enabled = true;
|
||||||
|
|
||||||
|
this.form_Main_SetControlsInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void form_Main_SetControlsInit()
|
||||||
|
{
|
||||||
|
// Init values for the controls
|
||||||
|
label16.Text = "";
|
||||||
|
}
|
||||||
// ################################ User input ################################
|
// ################################ User input ################################
|
||||||
private void con_Button_Listen_ON_Click(object sender, EventArgs e)
|
private void con_Button_Listen_ON_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -438,6 +446,9 @@ namespace Perun_v1
|
|||||||
// Do nothing , control does not require update
|
// Do nothing , control does not require update
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update mission status
|
||||||
|
label16.Text = Globals.CurrentMission.ToInfoString();
|
||||||
|
|
||||||
// Update status icons at main form - MySQL
|
// Update status icons at main form - MySQL
|
||||||
if ((DatabaseConnection.DatabaseStatus != Globals.StatusDatabase) || Globals.AppForceIconReload)
|
if ((DatabaseConnection.DatabaseStatus != Globals.StatusDatabase) || Globals.AppForceIconReload)
|
||||||
{
|
{
|
||||||
@@ -701,5 +712,9 @@ namespace Perun_v1
|
|||||||
con_Button_Listen_ON_Click(sender,e); // Simulate button click
|
con_Button_Listen_ON_Click(sender,e); // Simulate button click
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void label16_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user