Баг фикс

This commit is contained in:
klavirshik 2024-08-15 19:05:57 +02:00
parent 799b568820
commit bff2ecb330
13 changed files with 127 additions and 96 deletions

View File

@ -38,10 +38,10 @@
this.tabPage1 = new System.Windows.Forms.TabPage();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.imageList2 = new System.Windows.Forms.ImageList(this.components);
this.label2 = new System.Windows.Forms.Label();
this.bt_resetAll = new System.Windows.Forms.Button();
this.treeView1 = new Reseter2.NewTreeView();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.imageList2 = new System.Windows.Forms.ImageList(this.components);
this.tabPage3 = new System.Windows.Forms.TabPage();
this.button1 = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
@ -55,7 +55,8 @@
this.tabPage4 = new System.Windows.Forms.TabPage();
this.bt_wordsBilder = new System.Windows.Forms.Button();
this.checkControl1 = new Reseter2.CheckControl();
this.label2 = new System.Windows.Forms.Label();
this.treeView1 = new Reseter2.NewTreeView();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
@ -106,6 +107,7 @@
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Location = new System.Drawing.Point(2, 38);
this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";
@ -139,8 +141,8 @@
// tabPage2
//
this.tabPage2.Controls.Add(this.label2);
this.tabPage2.Controls.Add(this.checkControl1);
this.tabPage2.Controls.Add(this.bt_resetAll);
this.tabPage2.Controls.Add(this.checkControl1);
this.tabPage2.Controls.Add(this.treeView1);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
@ -150,13 +152,14 @@
this.tabPage2.Text = "Справочник";
this.tabPage2.UseVisualStyleBackColor = true;
//
// imageList2
// label2
//
this.imageList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream")));
this.imageList2.TransparentColor = System.Drawing.Color.Transparent;
this.imageList2.Images.SetKeyName(0, "off.ico");
this.imageList2.Images.SetKeyName(1, "on.ico");
this.imageList2.Images.SetKeyName(2, "or.ico");
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(32, 10);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(80, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Все элементы";
//
// bt_resetAll
//
@ -168,29 +171,6 @@
this.bt_resetAll.UseVisualStyleBackColor = true;
this.bt_resetAll.Click += new System.EventHandler(this.bt_resetAll_Click);
//
// treeView1
//
this.treeView1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.treeView1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.treeView1.HideSelection = false;
this.treeView1.ImageIndex = 0;
this.treeView1.ImageList = this.imageList1;
this.treeView1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.treeView1.Indent = 27;
this.treeView1.ItemHeight = 24;
this.treeView1.Location = new System.Drawing.Point(3, 32);
this.treeView1.Name = "treeView1";
this.treeView1.SelectedImageIndex = 0;
this.treeView1.ShowLines = false;
this.treeView1.ShowNodeToolTips = true;
this.treeView1.Size = new System.Drawing.Size(396, 653);
this.treeView1.StateImageList = this.imageList2;
this.treeView1.TabIndex = 0;
this.treeView1.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterCheck);
this.treeView1.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick);
this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick);
this.treeView1.MouseCaptureChanged += new System.EventHandler(this.treeView1_MouseCaptureChanged);
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
@ -205,6 +185,14 @@
this.imageList1.Images.SetKeyName(7, "17icon2-24.png");
this.imageList1.Images.SetKeyName(8, "40icon-24.png");
//
// imageList2
//
this.imageList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream")));
this.imageList2.TransparentColor = System.Drawing.Color.Transparent;
this.imageList2.Images.SetKeyName(0, "off.ico");
this.imageList2.Images.SetKeyName(1, "on.ico");
this.imageList2.Images.SetKeyName(2, "or.ico");
//
// tabPage3
//
this.tabPage3.Controls.Add(this.button1);
@ -245,7 +233,7 @@
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Cascadia Code", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.label5.Location = new System.Drawing.Point(185, 3);
this.label5.Location = new System.Drawing.Point(269, 3);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(43, 15);
this.label5.TabIndex = 4;
@ -326,7 +314,7 @@
//
// bt_wordsBilder
//
this.bt_wordsBilder.Location = new System.Drawing.Point(11, 33);
this.bt_wordsBilder.Location = new System.Drawing.Point(113, 6);
this.bt_wordsBilder.Name = "bt_wordsBilder";
this.bt_wordsBilder.Size = new System.Drawing.Size(155, 23);
this.bt_wordsBilder.TabIndex = 0;
@ -341,14 +329,38 @@
this.checkControl1.Size = new System.Drawing.Size(18, 18);
this.checkControl1.TabIndex = 2;
//
// label2
// treeView1
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(32, 10);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(80, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Все элементы";
this.treeView1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.treeView1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.treeView1.HideSelection = false;
this.treeView1.ImageIndex = 0;
this.treeView1.ImageList = this.imageList1;
this.treeView1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.treeView1.Indent = 27;
this.treeView1.ItemHeight = 24;
this.treeView1.Location = new System.Drawing.Point(3, 32);
this.treeView1.Name = "treeView1";
this.treeView1.SelectedImageIndex = 0;
this.treeView1.ShowLines = false;
this.treeView1.ShowNodeToolTips = true;
this.treeView1.Size = new System.Drawing.Size(396, 653);
this.treeView1.StateImageList = this.imageList2;
this.treeView1.TabIndex = 0;
this.treeView1.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterCheck);
this.treeView1.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick);
this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick);
this.treeView1.MouseCaptureChanged += new System.EventHandler(this.treeView1_MouseCaptureChanged);
//
// tabPage5
//
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(402, 688);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "О программе";
this.tabPage5.UseVisualStyleBackColor = true;
//
// Form1
//
@ -405,6 +417,7 @@
private NewTreeView treeView1;
private CheckControl checkControl1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TabPage tabPage5;
}
}

View File

@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAA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AAdYC5wEAAZABqQGtAgAB/wEz

View File

@ -54,6 +54,22 @@ namespace Reseter2.History
this.task = null;
this.statusTask = null;
}
public string NameNode()
{
string buf;
if (comp.GetName() == null)
{
buf = comp.GetNetNameStr();
}
else
{
buf = comp.GetName();
if (comp.GetNetNameStr() != null) buf += "(" + comp.GetNetNameStr() + ")";
}
return buf;
}
public string ToStr
{
@ -63,7 +79,9 @@ namespace Reseter2.History
this.statusTask = this.task.StatusTask;
this.statusName = this.statusTask.GetName();
}
string output = string.Format("{0,17:dd.MM.yy HH:mm:ss} {1,-12}{2,-22} {3,8:HH:mm:ss}", startTime, comp.GetResetName().ToString(), this.statusName, endTime);
string name = NameNode();
name = name.Length > 25 ? name.Substring(0,25): name;
string output = string.Format("{0,17:dd.MM.yy HH:mm:ss} {1,-25} {2,-9} {3,8:HH:mm:ss}", startTime, name, this.statusName, endTime);
return output;
}
}

View File

@ -38,7 +38,7 @@ namespace Reseter2
}
public override string GetName()
{
return "Отправка команды";
return "Send RST";
}
}
}

View File

@ -26,7 +26,7 @@ namespace Reseter2
public override string GetName()
{
return "Ошибка";
return "Error";
}
}
}

View File

@ -26,7 +26,7 @@ namespace Reseter2
}
public override string GetName()
{
return "Остановленно";
return "Stop";
}
}
}

View File

@ -27,7 +27,7 @@ namespace Reseter2
}
public override string GetName()
{
return "Успешно";
return "Succes";
}
}
}

View File

@ -36,7 +36,7 @@ namespace Reseter2
}
public override string GetName()
{
return "Перезагрузка";
return "Rebooting";
}
}
}

View File

@ -46,7 +46,7 @@ namespace Reseter2
}
public override string GetName()
{
return "Проверка связи";
return "Check net";
}
}

View File

@ -178,6 +178,7 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(520, 595);
this.Name = "BilderWords";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Редактор справочника";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BilderWords_FormClosing);
this.groupBox1.ResumeLayout(false);

View File

@ -275,13 +275,13 @@ namespace Reseter2.Words
{
ParentCategory = ChangeCategory;
ParentNodes = treeView1.Nodes;
index = selectNode.Index+1;
// index = selectNode.Index+1;
}
else
{
ParentCategory = (WordsCategory)selectNode.Parent.Tag;
ParentNodes = selectNode.Parent.Nodes;
index = selectNode.Index+1;
// index = selectNode.Index+1;
}
@ -300,6 +300,7 @@ namespace Reseter2.Words
break;
case 1:
item = new WordsComp(new CompId("Новый ПК"));
index = ParentCategory.Count();
WordsList.InsertItem(index, (WordsComp)item, ParentCategory);
treeNode.ImageIndex = 1;
treeNode.SelectedImageIndex = 1;
@ -315,7 +316,44 @@ namespace Reseter2.Words
private void BilderWords_FormClosing(object sender, FormClosingEventArgs e)
{
bool save = false;
if (control != null)
{
control.Visible = false;
control.Visible = true;
}
BinaryFormatter binaryFormatter = new BinaryFormatter();
MemoryStream Memory = new MemoryStream();
binaryFormatter.Serialize(Memory, ChangeCategory);
Memory.Position = 0;
byte[] hashSave = Hash.ComputeHash(Memory);
if (!hash.SequenceEqual(hashSave))
{
DialogResult result = MessageBox.Show("Сохранить внесенные изменения?", "Сохранение измененний", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
switch (result)
{
case DialogResult.Yes:
FileStream file = new FileStream("base.dat", FileMode.OpenOrCreate);
Memory.Position = 0;
Memory.CopyTo(file);
Memory.Close();
Memory.Dispose();
file.Close();
file.Dispose();
WordsList.MainCategory = ChangeCategory;
this.DialogResult = DialogResult.OK;
break;
case DialogResult.No:
this.DialogResult = DialogResult.Abort;
break;
case DialogResult.Cancel:
e.Cancel = true;
break;
}
}
}
private void bt_deleteItem_Click(object sender, EventArgs e)
@ -433,46 +471,7 @@ namespace Reseter2.Words
private void bt_close_Click(object sender, EventArgs e)
{
if (control != null)
{
control.Visible = false;
control.Dispose();
}
BinaryFormatter binaryFormatter = new BinaryFormatter();
MemoryStream Memory = new MemoryStream();
binaryFormatter.Serialize(Memory, ChangeCategory);
Memory.Position = 0;
byte[] hashSave = Hash.ComputeHash(Memory);
if (!hash.SequenceEqual(hashSave))
{
DialogResult result = MessageBox.Show("Внесенны изменения сохранить ли?", "Изменения не сохраненны", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
switch (result)
{
case DialogResult.Yes:
FileStream file = new FileStream("base.dat", FileMode.OpenOrCreate);
Memory.Position = 0;
Memory.CopyTo(file);
Memory.Close();
Memory.Dispose();
file.Close();
file.Dispose();
WordsList.MainCategory = ChangeCategory;
this.DialogResult = DialogResult.OK;
this.Close();
break;
case DialogResult.No:
this.DialogResult = DialogResult.Abort;
this.Close();
break;
}
}
else
{
this.Close();
}
this.Close();
}
}
}

View File

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACQ
JAAAAk1TRnQBSQFMAgEBCQEAAUgBAAFIAQABEAEAARABAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAFA
JAAAAk1TRnQBSQFMAgEBCQEAAVgBAAFYAQABEAEAARABAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABMAMAAQEBAAEQBgABGBIAAf8BfwH/AX8B/wF/Af8BfwH/AX8B/wF/Af8BfwH/AX8B/wF/Af8BfwH/
AX8B/wF/Af8BfwH/AX8B/wF/Af8Bf2AAAf8BfwH/AX8B/wF/Af8BfwH/AX8B/wF/Af8BfwH/AX8B/wF/
Af8BfwH/AX8B/wF/Af8BfwH/AX8B/wF/Af8Bf2AAAf8BfwH/AX8B/wF/Af8BfwH/AX8B/wF/Af8BfwH/

View File

@ -113,7 +113,7 @@
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 13);
this.label1.TabIndex = 9;
this.label1.Text = "Значек";
this.label1.Text = "Значок";
//
// label5
//