Files
ATV_STDLabelAttach/QRValidation/Project/Setting/fSetting.cs
atvstdla dc66158497 Add QRValidation project to repository
- Added QRValidation vision control system
- Includes CapCleaningControl UI components
- WebSocket-based barcode validation system
- Support for Crevis PLC integration
- Test projects for PLC emulator, motion, IO panel, and Modbus

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 11:38:38 +09:00

101 lines
2.8 KiB
C#

using AR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Project
{
public partial class fSetting : Form
{
CSetting dummySetting; //Temporarily saves settings and overwrites them when complete.
public fSetting()
{
InitializeComponent();
//setting
dummySetting = new CSetting();
PUB.setting.CopyTo(dummySetting);
this.KeyDown += (s1, e1) =>
{
if (e1.KeyCode == Keys.Escape)
this.Close();
if (DateTime.Now > PUB.LastInputTime) PUB.LastInputTime = DateTime.Now;
};
this.MouseMove += (s1, e1) => { if (DateTime.Now > PUB.LastInputTime) PUB.LastInputTime = DateTime.Now; };
this.FormClosed += __Closed;
}
private void __Closed(object sender, FormClosedEventArgs e)
{
}
private void __Load(object sender, EventArgs e)
{
this.Show();
this.propertyGrid1.SelectedObject = this.dummySetting;
this.propertyGrid1.Refresh();
//if (Pub.setting.Disable_UsingDataMatrix == true) btInspectDotDM.Text = "DOT Inspect";
//else btInspectDotDM.Text = "DM Inspect";
}
private void button1_Click(object sender, EventArgs e)
{
using (var f = new AR.Dialog.fPassword())
if (f.ShowDialog() == DialogResult.OK)
{
var pass = f.tbInput.Text;
if (pass != this.dummySetting.Password_Setup)
{
UTIL.MsgE("Password incorrect");
return;
}
this.Invalidate();
try
{
dummySetting.CopyTo(PUB.setting);
PUB.setting.Save();
PUB.log_[0].AddI("Setting Save");
PUB.log_[0].Add(PUB.setting.ToString());
PUB.log_[1].AddI("Setting Save");
PUB.log_[1].Add(PUB.setting.ToString());
}
catch (Exception ex)
{
PUB.log_[0].AddE("Setting Save Error:" + ex.Message);
PUB.log_[1].AddE("Setting Save Error:" + ex.Message);
UTIL.MsgE("Error\n" + ex.Message + "\n\nPlease try again");
}
//Pub.flag.set(eFlag.TestRun, btLoaderDetect.BackColor == Color.Lime);
DialogResult = DialogResult.OK;
}
}
}
}