First Commit. Must be tested

This commit is contained in:
Nicola Carminati
2019-07-25 12:18:46 +02:00
parent 95f0ec3e25
commit fc56b0e4c9
13 changed files with 5886 additions and 76 deletions
Binary file not shown.
+8
View File
@@ -1314,5 +1314,13 @@ namespace Step.NC
return true;
}
public bool ResetMaintenanceCounter(uint counter)
{
CmsError cmsError = numericalControl.PLC_WResetMachineCounters(counter);
if (cmsError.IsError())
return false;
return true;
}
}
}
+17 -44
View File
@@ -29,6 +29,7 @@
private void InitializeComponent()
{
this.Panel1 = new System.Windows.Forms.Panel();
this.labelValue = new System.Windows.Forms.Label();
this.textBoxHours = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.comboBoxSpindle = new System.Windows.Forms.ComboBox();
@@ -37,9 +38,6 @@
this.Label_NewPassword = new System.Windows.Forms.Label();
this.TableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.OK_Pwd_Button = new System.Windows.Forms.Button();
this.textBoxNewVal = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.labelValue = new System.Windows.Forms.Label();
this.Panel1.SuspendLayout();
this.TableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
@@ -52,8 +50,6 @@
this.Panel1.BackColor = System.Drawing.Color.White;
this.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Panel1.Controls.Add(this.labelValue);
this.Panel1.Controls.Add(this.textBoxNewVal);
this.Panel1.Controls.Add(this.label3);
this.Panel1.Controls.Add(this.textBoxHours);
this.Panel1.Controls.Add(this.label2);
this.Panel1.Controls.Add(this.comboBoxSpindle);
@@ -62,9 +58,20 @@
this.Panel1.Controls.Add(this.Label_NewPassword);
this.Panel1.Location = new System.Drawing.Point(-6, -2);
this.Panel1.Name = "Panel1";
this.Panel1.Size = new System.Drawing.Size(327, 177);
this.Panel1.Size = new System.Drawing.Size(327, 142);
this.Panel1.TabIndex = 4;
//
// labelValue
//
this.labelValue.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelValue.Location = new System.Drawing.Point(116, 73);
this.labelValue.Name = "labelValue";
this.labelValue.Size = new System.Drawing.Size(186, 26);
this.labelValue.TabIndex = 15;
this.labelValue.Tag = "Password";
this.labelValue.Text = "Actual Value";
this.labelValue.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// textBoxHours
//
this.textBoxHours.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@@ -114,7 +121,7 @@
// TextBox_Password
//
this.TextBox_Password.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.TextBox_Password.Location = new System.Drawing.Point(116, 134);
this.TextBox_Password.Location = new System.Drawing.Point(116, 102);
this.TextBox_Password.Name = "TextBox_Password";
this.TextBox_Password.PasswordChar = '*';
this.TextBox_Password.Size = new System.Drawing.Size(186, 26);
@@ -126,7 +133,7 @@
//
this.Label_NewPassword.AutoSize = true;
this.Label_NewPassword.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label_NewPassword.Location = new System.Drawing.Point(41, 137);
this.Label_NewPassword.Location = new System.Drawing.Point(41, 105);
this.Label_NewPassword.Name = "Label_NewPassword";
this.Label_NewPassword.Size = new System.Drawing.Size(69, 18);
this.Label_NewPassword.TabIndex = 7;
@@ -140,7 +147,7 @@
this.TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.TableLayoutPanel1.Controls.Add(this.OK_Pwd_Button, 1, 0);
this.TableLayoutPanel1.Location = new System.Drawing.Point(79, 186);
this.TableLayoutPanel1.Location = new System.Drawing.Point(79, 151);
this.TableLayoutPanel1.Name = "TableLayoutPanel1";
this.TableLayoutPanel1.RowCount = 1;
this.TableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
@@ -158,49 +165,17 @@
this.OK_Pwd_Button.Text = "Reset";
this.OK_Pwd_Button.Click += new System.EventHandler(this.OK_Pwd_Button_Click);
//
// textBoxNewVal
//
this.textBoxNewVal.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxNewVal.Location = new System.Drawing.Point(116, 102);
this.textBoxNewVal.Name = "textBoxNewVal";
this.textBoxNewVal.Size = new System.Drawing.Size(186, 26);
this.textBoxNewVal.TabIndex = 13;
this.textBoxNewVal.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(34, 105);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(76, 18);
this.label3.TabIndex = 14;
this.label3.Tag = "Password";
this.label3.Text = "New Value";
//
// labelValue
//
this.labelValue.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelValue.Location = new System.Drawing.Point(116, 73);
this.labelValue.Name = "labelValue";
this.labelValue.Size = new System.Drawing.Size(186, 26);
this.labelValue.TabIndex = 15;
this.labelValue.Tag = "Password";
this.labelValue.Text = "Actual Value";
this.labelValue.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// ResetCountersForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(310, 244);
this.ClientSize = new System.Drawing.Size(310, 209);
this.Controls.Add(this.Panel1);
this.Controls.Add(this.TableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ResetCountersForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Reset Counters";
this.Load += new System.EventHandler(this.PasswordForm_Load);
@@ -222,8 +197,6 @@
internal System.Windows.Forms.Label label1;
internal System.Windows.Forms.TextBox textBoxHours;
internal System.Windows.Forms.Label label2;
internal System.Windows.Forms.TextBox textBoxNewVal;
internal System.Windows.Forms.Label label3;
internal System.Windows.Forms.Label labelValue;
}
}
+7 -13
View File
@@ -1,4 +1,5 @@
using Step.NC;
using CMS_CORE_Library.Models;
using Step.NC;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -8,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.UI
{
@@ -72,14 +74,6 @@ namespace Step.UI
return;
}
uint val = 0;
bool isNumber = uint.TryParse(textBoxNewVal.Text, out val);
if (!isNumber)
{
MessageBox.Show("New-Value must be a number", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// sfrutto password delle teste, passando la testa 0
if (!Utils.CandiesController.HeadsPasswordCheck(psw, Convert.ToInt32(Matricola), 0))
{
@@ -87,7 +81,7 @@ namespace Step.UI
return;
}
if (!Nc.ResetMachineWTime(val))
if (!Nc.ResetMaintenanceCounter((uint) comboBoxSpindle.SelectedIndex))
{
MessageBox.Show("Error While Resetting time", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
@@ -96,7 +90,6 @@ namespace Step.UI
MessageBox.Show("Time resetted", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
ReadHours();
TextBox_Password.Text = "";
textBoxNewVal.Text = "";
}
private void ReadHours()
@@ -111,15 +104,16 @@ namespace Step.UI
uint realVal = 0;
uint secs = 0;
uint hours = 0;
;
if (!Nc.ReadMachineWTime(out realVal))
List<CounterModel> Contatori = new List<CounterModel>();
if (Nc.GetMainenancesCounter(out Contatori) != NO_ERROR)
{
MessageBox.Show("Error While reading time", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
else
{
realVal = Contatori.FirstOrDefault(X => X.Id == (comboBoxSpindle.SelectedIndex - 1)).Value;
uint min = Convert.ToUInt32(Math.Floor((double)realVal / 60));
secs = realVal % 60;
if (min >= 60)
File diff suppressed because it is too large Load Diff
+212
View File
@@ -0,0 +1,212 @@
namespace Step.UI
{
partial class ResetMachineHoursForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ResetMachineHoursForm));
this.Panel1 = new System.Windows.Forms.Panel();
this.labelValue = new System.Windows.Forms.Label();
this.textBoxNewVal = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBoxHours = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.TextBox_Password = new System.Windows.Forms.TextBox();
this.Label_NewPassword = new System.Windows.Forms.Label();
this.TableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.Reload_Button = new System.Windows.Forms.Button();
this.OK_Pwd_Button = new System.Windows.Forms.Button();
this.Panel1.SuspendLayout();
this.TableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// Panel1
//
this.Panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Panel1.BackColor = System.Drawing.Color.White;
this.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Panel1.Controls.Add(this.labelValue);
this.Panel1.Controls.Add(this.textBoxNewVal);
this.Panel1.Controls.Add(this.label3);
this.Panel1.Controls.Add(this.textBoxHours);
this.Panel1.Controls.Add(this.label2);
this.Panel1.Controls.Add(this.TextBox_Password);
this.Panel1.Controls.Add(this.Label_NewPassword);
this.Panel1.Location = new System.Drawing.Point(-6, -2);
this.Panel1.Name = "Panel1";
this.Panel1.Size = new System.Drawing.Size(327, 136);
this.Panel1.TabIndex = 4;
//
// labelValue
//
this.labelValue.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelValue.Location = new System.Drawing.Point(116, 36);
this.labelValue.Name = "labelValue";
this.labelValue.Size = new System.Drawing.Size(186, 26);
this.labelValue.TabIndex = 15;
this.labelValue.Tag = "Password";
this.labelValue.Text = "Actual Value";
this.labelValue.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// textBoxNewVal
//
this.textBoxNewVal.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxNewVal.Location = new System.Drawing.Point(116, 65);
this.textBoxNewVal.Name = "textBoxNewVal";
this.textBoxNewVal.Size = new System.Drawing.Size(186, 26);
this.textBoxNewVal.TabIndex = 13;
this.textBoxNewVal.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(34, 68);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(76, 18);
this.label3.TabIndex = 14;
this.label3.Tag = "Password";
this.label3.Text = "New Value";
//
// textBoxHours
//
this.textBoxHours.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxHours.Location = new System.Drawing.Point(116, 7);
this.textBoxHours.Name = "textBoxHours";
this.textBoxHours.ReadOnly = true;
this.textBoxHours.Size = new System.Drawing.Size(186, 26);
this.textBoxHours.TabIndex = 11;
this.textBoxHours.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(23, 10);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(87, 18);
this.label2.TabIndex = 12;
this.label2.Tag = "Password";
this.label2.Text = "Actual Value";
//
// TextBox_Password
//
this.TextBox_Password.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.TextBox_Password.Location = new System.Drawing.Point(116, 97);
this.TextBox_Password.Name = "TextBox_Password";
this.TextBox_Password.PasswordChar = '*';
this.TextBox_Password.Size = new System.Drawing.Size(186, 26);
this.TextBox_Password.TabIndex = 1;
this.TextBox_Password.UseSystemPasswordChar = true;
this.TextBox_Password.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBox_Password_KeyDown);
//
// Label_NewPassword
//
this.Label_NewPassword.AutoSize = true;
this.Label_NewPassword.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label_NewPassword.Location = new System.Drawing.Point(41, 100);
this.Label_NewPassword.Name = "Label_NewPassword";
this.Label_NewPassword.Size = new System.Drawing.Size(69, 18);
this.Label_NewPassword.TabIndex = 7;
this.Label_NewPassword.Tag = "Password";
this.Label_NewPassword.Text = "Password";
//
// TableLayoutPanel1
//
this.TableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.TableLayoutPanel1.ColumnCount = 2;
this.TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.TableLayoutPanel1.Controls.Add(this.Reload_Button, 0, 0);
this.TableLayoutPanel1.Controls.Add(this.OK_Pwd_Button, 1, 0);
this.TableLayoutPanel1.Location = new System.Drawing.Point(79, 145);
this.TableLayoutPanel1.Name = "TableLayoutPanel1";
this.TableLayoutPanel1.RowCount = 1;
this.TableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.TableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 46F));
this.TableLayoutPanel1.Size = new System.Drawing.Size(219, 46);
this.TableLayoutPanel1.TabIndex = 3;
//
// Reload_Button
//
this.Reload_Button.Anchor = System.Windows.Forms.AnchorStyles.None;
this.Reload_Button.Location = new System.Drawing.Point(3, 3);
this.Reload_Button.Name = "Reload_Button";
this.Reload_Button.Size = new System.Drawing.Size(103, 39);
this.Reload_Button.TabIndex = 6;
this.Reload_Button.Text = "Reload";
this.Reload_Button.Click += new System.EventHandler(this.Reload_Button_Click);
//
// OK_Pwd_Button
//
this.OK_Pwd_Button.Anchor = System.Windows.Forms.AnchorStyles.None;
this.OK_Pwd_Button.Location = new System.Drawing.Point(112, 3);
this.OK_Pwd_Button.Name = "OK_Pwd_Button";
this.OK_Pwd_Button.Size = new System.Drawing.Size(103, 39);
this.OK_Pwd_Button.TabIndex = 5;
this.OK_Pwd_Button.Text = "Reset";
this.OK_Pwd_Button.Click += new System.EventHandler(this.OK_Pwd_Button_Click);
//
// ResetMachineHoursForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(310, 203);
this.Controls.Add(this.Panel1);
this.Controls.Add(this.TableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ResetMachineHoursForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Reset Machine Working-Hours";
this.Load += new System.EventHandler(this.PasswordForm_Load);
this.Panel1.ResumeLayout(false);
this.Panel1.PerformLayout();
this.TableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
internal System.Windows.Forms.Panel Panel1;
internal System.Windows.Forms.TextBox TextBox_Password;
internal System.Windows.Forms.Label Label_NewPassword;
internal System.Windows.Forms.TableLayoutPanel TableLayoutPanel1;
internal System.Windows.Forms.Button OK_Pwd_Button;
internal System.Windows.Forms.TextBox textBoxHours;
internal System.Windows.Forms.Label label2;
internal System.Windows.Forms.TextBox textBoxNewVal;
internal System.Windows.Forms.Label label3;
internal System.Windows.Forms.Label labelValue;
internal System.Windows.Forms.Button Reload_Button;
}
}
+121
View File
@@ -0,0 +1,121 @@
using Step.NC;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Step.UI
{
public partial class ResetMachineHoursForm : Form
{
private NcHandler Nc;
private String Matricola;
public ResetMachineHoursForm()
{
InitializeComponent();
}
public void setNcData(String matr, NcHandler Nch)
{
this.Matricola = matr;
this.Text = "Reset Machine Working-Hours - " + this.Matricola;
this.Nc = Nch;
}
private void Cancel_Pwd_Button_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void OK_Pwd_Button_Click(object sender, EventArgs e)
{
checkPSW(TextBox_Password.Text);
}
private void PasswordForm_Load(object sender, EventArgs e)
{
TextBox_Password.Text = "";
this.ActiveControl = textBoxNewVal;
ReadHours();
}
private void TextBox_Password_KeyDown(object sender, KeyEventArgs e)
{
checkPSW(TextBox_Password.Text);
}
private void Reload_Button_Click(object sender, EventArgs e)
{
ReadHours();
}
private void checkPSW(String psw)
{
if(Matricola== null || Matricola.Trim() == "" || Convert.ToInt32(Matricola) <= 0)
{
MessageBox.Show("Machine ID non correct", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
uint val = 0;
bool isNumber = uint.TryParse(textBoxNewVal.Text, out val);
if (!isNumber)
{
MessageBox.Show("New-Value must be a number", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// sfrutto password delle teste, passando la testa 0
if (!Utils.CandiesController.HeadsPasswordCheck(psw, Convert.ToInt32(Matricola), 0))
{
MessageBox.Show("Wrong password", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (!Nc.ResetMachineWTime(val))
{
MessageBox.Show("Error While Resetting time", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
MessageBox.Show("Time resetted", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
ReadHours();
TextBox_Password.Text = "";
textBoxNewVal.Text = "";
}
private void ReadHours()
{
uint realVal = 0;
uint secs = 0;
uint hours = 0;
;
if (!Nc.ReadMachineWTime(out realVal))
{
MessageBox.Show("Error While reading time", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
else
{
uint min = Convert.ToUInt32(Math.Floor((double)realVal / 60));
secs = realVal % 60;
if (min >= 60)
{
hours = Convert.ToUInt32(Math.Floor((double)min / 60));
min = min % 60;
}
textBoxHours.Text = hours.ToString() + "h " + min.ToString() + "m " + secs.ToString() + "s";
labelValue.Text = realVal.ToString();
}
}
}
}
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ResetSpindleForm));
this.Panel1 = new System.Windows.Forms.Panel();
this.textBoxHours = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
@@ -179,10 +180,10 @@
this.Controls.Add(this.Panel1);
this.Controls.Add(this.TableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ResetSpindleForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Reset Spindle Active Time";
this.Load += new System.EventHandler(this.PasswordForm_Load);
File diff suppressed because it is too large Load Diff
+40 -18
View File
@@ -67,6 +67,8 @@ namespace Step.UI
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.resetSpindleHoursToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.resetCountersToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.resetMachineWorkingHoursToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resetMachineWorkingHoursToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.NotifyIconMenu.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
@@ -80,7 +82,7 @@ namespace Step.UI
this.StepNotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("StepNotifyIcon.Icon")));
this.StepNotifyIcon.Text = "Active";
this.StepNotifyIcon.Visible = true;
this.StepNotifyIcon.Click += new System.EventHandler(this.NotifyIcon_Click);
this.StepNotifyIcon.DoubleClick += new System.EventHandler(this.NotifyIcon_Click);
//
// NotifyIconMenu
//
@@ -99,7 +101,8 @@ namespace Step.UI
this.goBackToStandardModeToolStripMenuItem,
this.toolStripSeparator,
this.resetSpindleHoursToolStripMenuItem,
this.resetCountersToolStripMenuItem});
this.resetCountersToolStripMenuItem,
this.resetMachineWorkingHoursToolStripMenuItem});
this.adminMachineToolStripMenuItem.Name = "adminMachineToolStripMenuItem";
this.adminMachineToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.adminMachineToolStripMenuItem.Text = "Service";
@@ -108,7 +111,7 @@ namespace Step.UI
//
this.passwordToolStripMenuItem.Image = global::Step.UI.Properties.Resources.Apps_Lock_icon;
this.passwordToolStripMenuItem.Name = "passwordToolStripMenuItem";
this.passwordToolStripMenuItem.Size = new System.Drawing.Size(214, 22);
this.passwordToolStripMenuItem.Size = new System.Drawing.Size(234, 22);
this.passwordToolStripMenuItem.Text = "Password";
this.passwordToolStripMenuItem.Click += new System.EventHandler(this.passwordToolStripMenuItem_Click);
//
@@ -116,7 +119,7 @@ namespace Step.UI
//
this.goBackToStandardModeToolStripMenuItem.Image = global::Step.UI.Properties.Resources.Apps_Unlock_icon;
this.goBackToStandardModeToolStripMenuItem.Name = "goBackToStandardModeToolStripMenuItem";
this.goBackToStandardModeToolStripMenuItem.Size = new System.Drawing.Size(214, 22);
this.goBackToStandardModeToolStripMenuItem.Size = new System.Drawing.Size(234, 22);
this.goBackToStandardModeToolStripMenuItem.Text = "Go back to standard mode";
this.goBackToStandardModeToolStripMenuItem.Visible = false;
this.goBackToStandardModeToolStripMenuItem.Click += new System.EventHandler(this.goBackToStandardModeToolStripMenuItem_Click);
@@ -124,13 +127,13 @@ namespace Step.UI
// toolStripSeparator
//
this.toolStripSeparator.Name = "toolStripSeparator";
this.toolStripSeparator.Size = new System.Drawing.Size(211, 6);
this.toolStripSeparator.Size = new System.Drawing.Size(231, 6);
this.toolStripSeparator.Visible = false;
//
// resetSpindleHoursToolStripMenuItem
//
this.resetSpindleHoursToolStripMenuItem.Name = "resetSpindleHoursToolStripMenuItem";
this.resetSpindleHoursToolStripMenuItem.Size = new System.Drawing.Size(214, 22);
this.resetSpindleHoursToolStripMenuItem.Size = new System.Drawing.Size(234, 22);
this.resetSpindleHoursToolStripMenuItem.Text = "Reset Spindle Active Time";
this.resetSpindleHoursToolStripMenuItem.Visible = false;
this.resetSpindleHoursToolStripMenuItem.Click += new System.EventHandler(this.resetSpindleHoursToolStripMenuItem_Click);
@@ -138,8 +141,8 @@ namespace Step.UI
// resetCountersToolStripMenuItem
//
this.resetCountersToolStripMenuItem.Name = "resetCountersToolStripMenuItem";
this.resetCountersToolStripMenuItem.Size = new System.Drawing.Size(214, 22);
this.resetCountersToolStripMenuItem.Text = "Reset Counters";
this.resetCountersToolStripMenuItem.Size = new System.Drawing.Size(234, 22);
this.resetCountersToolStripMenuItem.Text = "Reset CMS-Active Counters";
this.resetCountersToolStripMenuItem.Visible = false;
this.resetCountersToolStripMenuItem.Click += new System.EventHandler(this.resetCountersToolStripMenuItem_Click);
//
@@ -352,14 +355,14 @@ namespace Step.UI
// closeCMSServerToolStripMenuItem
//
this.closeCMSServerToolStripMenuItem.Name = "closeCMSServerToolStripMenuItem";
this.closeCMSServerToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.closeCMSServerToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.closeCMSServerToolStripMenuItem.Text = "Close Active Server";
this.closeCMSServerToolStripMenuItem.Click += new System.EventHandler(this.closeCMSServerToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(171, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
//
// serviceToolStripMenuItem
//
@@ -368,16 +371,17 @@ namespace Step.UI
this.goBackToStandardModeToolStripMenuItem1,
this.toolStripSeparator1,
this.resetSpindleHoursToolStripMenuItem1,
this.resetCountersToolStripMenuItem1});
this.resetCountersToolStripMenuItem1,
this.resetMachineWorkingHoursToolStripMenuItem1});
this.serviceToolStripMenuItem.Name = "serviceToolStripMenuItem";
this.serviceToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.serviceToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.serviceToolStripMenuItem.Text = "Service";
//
// passwordToolStripMenuItem1
//
this.passwordToolStripMenuItem1.Image = global::Step.UI.Properties.Resources.Apps_Lock_icon;
this.passwordToolStripMenuItem1.Name = "passwordToolStripMenuItem1";
this.passwordToolStripMenuItem1.Size = new System.Drawing.Size(214, 22);
this.passwordToolStripMenuItem1.Size = new System.Drawing.Size(234, 22);
this.passwordToolStripMenuItem1.Text = "Password";
this.passwordToolStripMenuItem1.Click += new System.EventHandler(this.passwordToolStripMenuItem1_Click);
//
@@ -385,7 +389,7 @@ namespace Step.UI
//
this.goBackToStandardModeToolStripMenuItem1.Image = global::Step.UI.Properties.Resources.Apps_Unlock_icon;
this.goBackToStandardModeToolStripMenuItem1.Name = "goBackToStandardModeToolStripMenuItem1";
this.goBackToStandardModeToolStripMenuItem1.Size = new System.Drawing.Size(214, 22);
this.goBackToStandardModeToolStripMenuItem1.Size = new System.Drawing.Size(234, 22);
this.goBackToStandardModeToolStripMenuItem1.Text = "Go back to standard mode";
this.goBackToStandardModeToolStripMenuItem1.Visible = false;
this.goBackToStandardModeToolStripMenuItem1.Click += new System.EventHandler(this.goBackToStandardModeToolStripMenuItem1_Click);
@@ -393,13 +397,13 @@ namespace Step.UI
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(211, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(231, 6);
this.toolStripSeparator1.Visible = false;
//
// resetSpindleHoursToolStripMenuItem1
//
this.resetSpindleHoursToolStripMenuItem1.Name = "resetSpindleHoursToolStripMenuItem1";
this.resetSpindleHoursToolStripMenuItem1.Size = new System.Drawing.Size(214, 22);
this.resetSpindleHoursToolStripMenuItem1.Size = new System.Drawing.Size(234, 22);
this.resetSpindleHoursToolStripMenuItem1.Text = "Reset Spindle Active Time";
this.resetSpindleHoursToolStripMenuItem1.Visible = false;
this.resetSpindleHoursToolStripMenuItem1.Click += new System.EventHandler(this.resetSpindleHoursToolStripMenuItem1_Click);
@@ -407,11 +411,27 @@ namespace Step.UI
// resetCountersToolStripMenuItem1
//
this.resetCountersToolStripMenuItem1.Name = "resetCountersToolStripMenuItem1";
this.resetCountersToolStripMenuItem1.Size = new System.Drawing.Size(214, 22);
this.resetCountersToolStripMenuItem1.Text = "Reset Counters";
this.resetCountersToolStripMenuItem1.Size = new System.Drawing.Size(234, 22);
this.resetCountersToolStripMenuItem1.Text = "Reset CMS-Active Counters";
this.resetCountersToolStripMenuItem1.Visible = false;
this.resetCountersToolStripMenuItem1.Click += new System.EventHandler(this.resetCountersToolStripMenuItem1_Click);
//
// resetMachineWorkingHoursToolStripMenuItem
//
this.resetMachineWorkingHoursToolStripMenuItem.Name = "resetMachineWorkingHoursToolStripMenuItem";
this.resetMachineWorkingHoursToolStripMenuItem.Size = new System.Drawing.Size(234, 22);
this.resetMachineWorkingHoursToolStripMenuItem.Text = "Reset Machine Working Hours";
this.resetMachineWorkingHoursToolStripMenuItem.Visible = false;
this.resetMachineWorkingHoursToolStripMenuItem.Click += new System.EventHandler(this.resetMachineWorkingHoursToolStripMenuItem_Click);
//
// resetMachineWorkingHoursToolStripMenuItem1
//
this.resetMachineWorkingHoursToolStripMenuItem1.Name = "resetMachineWorkingHoursToolStripMenuItem1";
this.resetMachineWorkingHoursToolStripMenuItem1.Size = new System.Drawing.Size(234, 22);
this.resetMachineWorkingHoursToolStripMenuItem1.Text = "Reset Machine Working Hours";
this.resetMachineWorkingHoursToolStripMenuItem1.Visible = false;
this.resetMachineWorkingHoursToolStripMenuItem1.Click += new System.EventHandler(this.resetMachineWorkingHoursToolStripMenuItem1_Click);
//
// ServerControlWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -479,5 +499,7 @@ namespace Step.UI
private ToolStripMenuItem resetCountersToolStripMenuItem1;
private ToolStripSeparator toolStripSeparator3;
private ToolStripSeparator toolStripSeparator2;
private ToolStripMenuItem resetMachineWorkingHoursToolStripMenuItem;
private ToolStripMenuItem resetMachineWorkingHoursToolStripMenuItem1;
}
}
+19
View File
@@ -30,6 +30,7 @@ namespace Step.UI
PasswordForm PswForm;
ResetSpindleForm ResSpForm;
ResetCountersForm ResCouForm;
ResetMachineHoursForm ResMaHouForm;
LockForm LckFrm;
[DllImport("user32.dll")]
@@ -60,6 +61,7 @@ namespace Step.UI
PswForm = new PasswordForm();
ResSpForm = new ResetSpindleForm();
ResCouForm = new ResetCountersForm();
ResMaHouForm = new ResetMachineHoursForm();
if (NcConfig != null && NcConfig.NcVendor != null)
TXTType.Text = NcConfig.NcVendor;
@@ -238,7 +240,9 @@ namespace Step.UI
PswForm.setNcData(model.CmsMachineIdNumber,nc);
ResSpForm.setNcData(model.CmsMachineIdNumber,nc);
ResCouForm.setNcData(model.CmsMachineIdNumber,nc);
ResMaHouForm.setNcData(model.CmsMachineIdNumber,nc);
passwordToolStripMenuItem.Enabled = true;
passwordToolStripMenuItem1.Enabled = true;
});
}
else
@@ -250,6 +254,7 @@ namespace Step.UI
TXTMachId.Text = "---";
CHNcConnected.Checked = false;
passwordToolStripMenuItem.Enabled = false;
passwordToolStripMenuItem1.Enabled = false;
});
}
@@ -307,6 +312,8 @@ namespace Step.UI
resetSpindleHoursToolStripMenuItem1.Visible = true;
goBackToStandardModeToolStripMenuItem.Visible = true;
goBackToStandardModeToolStripMenuItem1.Visible = true;
resetMachineWorkingHoursToolStripMenuItem.Visible = true;
resetMachineWorkingHoursToolStripMenuItem1.Visible = true;
toolStripSeparator.Visible = true;
toolStripSeparator1.Visible = true;
passwordToolStripMenuItem.Enabled = false;
@@ -323,6 +330,8 @@ namespace Step.UI
resetSpindleHoursToolStripMenuItem1.Visible = false;
goBackToStandardModeToolStripMenuItem.Visible = false;
goBackToStandardModeToolStripMenuItem1.Visible = false;
resetMachineWorkingHoursToolStripMenuItem.Visible = false;
resetMachineWorkingHoursToolStripMenuItem1.Visible = false;
toolStripSeparator.Visible = false;
toolStripSeparator1.Visible = false;
passwordToolStripMenuItem.Enabled = true;
@@ -376,5 +385,15 @@ namespace Step.UI
{
ResCouForm.ShowDialog();
}
private void resetMachineWorkingHoursToolStripMenuItem_Click(object sender, EventArgs e)
{
ResMaHouForm.ShowDialog();
}
private void resetMachineWorkingHoursToolStripMenuItem1_Click(object sender, EventArgs e)
{
ResMaHouForm.ShowDialog();
}
}
}
+9
View File
@@ -64,6 +64,12 @@
<Compile Include="Dialogs\LockForm.Designer.cs">
<DependentUpon>LockForm.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\ResetMachineHoursForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dialogs\ResetMachineHoursForm.Designer.cs">
<DependentUpon>ResetMachineHoursForm.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\ResetCountersForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -109,6 +115,9 @@
<EmbeddedResource Include="Dialogs\LockForm.resx">
<DependentUpon>LockForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\ResetMachineHoursForm.resx">
<DependentUpon>ResetMachineHoursForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\ResetCountersForm.resx">
<DependentUpon>ResetCountersForm.cs</DependentUpon>
</EmbeddedResource>