首次上传
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<UserControl x:Class="MECF.Framework.RT.Core.Backend.BackendIDExportView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MECF.Framework.RT.Core.Backend"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="600" d:DesignWidth="1000">
|
||||
<Canvas>
|
||||
<Button x:Name="btExportEcid" Content="Export ECID" Command="{Binding ExportEcidCommand}" Width="150" Height="30" Canvas.Left="100" Canvas.Top="100"/>
|
||||
|
||||
<Button x:Name="btExportSvid" Content="Export Chamber SVID" Command="{Binding ExportSvidCommand}" Width="150" Height="30" Canvas.Left="100" Canvas.Top="150"/>
|
||||
|
||||
<Button x:Name="btExportTMSvid" Content="Export TM SVID" Command="{Binding ExportTMSvidCommand}" Width="150" Height="30" Canvas.Left="100" Canvas.Top="200"/>
|
||||
|
||||
<Button x:Name="btExportAlid" Content="Export ALID" Command="{Binding ExportAlidCommand}" Width="150" Height="30" Canvas.Left="100" Canvas.Top="250" Visibility="Hidden"/>
|
||||
</Canvas>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,470 @@
|
||||
using Aitex.Core.RT.DataCenter;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using Aitex.Core.UI.MVVM;
|
||||
using Aitex.Core.Util;
|
||||
using MECF.Framework.Common.Utilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MECF.Framework.RT.Core.Backend
|
||||
{
|
||||
/// <summary>
|
||||
/// IDExport.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class BackendIDExportView : UserControl
|
||||
{
|
||||
public BackendIDExportView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = new BackendIDExportViewModel();
|
||||
|
||||
this.IsVisibleChanged += IDExportViewModel_IsVisibleChanged;
|
||||
}
|
||||
|
||||
private void IDExportViewModel_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
(DataContext as SubscriptionViewModelBase).EnableTimer(IsVisible);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class BackendIDExportViewModel : SubscriptionViewModelBase
|
||||
{
|
||||
|
||||
#region Command
|
||||
|
||||
public ICommand ExportEcidCommand { get; set; }
|
||||
public ICommand ExportAlidCommand { get; set; }
|
||||
public ICommand ExportSvidCommand { get; set; }
|
||||
public ICommand ExportTMSvidCommand { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public BackendIDExportViewModel() : base("BackendIDExportViewModel")
|
||||
{
|
||||
ExportEcidCommand = new DelegateCommand<object>(PerformExportEcid);
|
||||
//ExportAlidCommand = new DelegateCommand<object>(PerformExportAlid);
|
||||
ExportSvidCommand = new DelegateCommand<object>(PerformExportSvid);
|
||||
ExportTMSvidCommand = new DelegateCommand<object>(PerformExportTMSvid);
|
||||
}
|
||||
|
||||
private void PerformExportEcid(object obj)
|
||||
{
|
||||
var lists = SC.GetItemList();
|
||||
int id = 3001;
|
||||
|
||||
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
|
||||
dlg.DefaultExt = ".xlsx"; // Default file extension
|
||||
dlg.FileName = $"Equipment_Constant_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
dlg.Filter = "Excel数据表格文件(*.xlsx)|*.xlsx"; // Filter files by extension
|
||||
bool? result = dlg.ShowDialog();// Show open file dialog box
|
||||
|
||||
if (result == true)
|
||||
{
|
||||
System.Data.DataSet ds = new System.Data.DataSet();
|
||||
ds.Tables.Add(new System.Data.DataTable("ECID(Equipment Constant)"));
|
||||
ds.Tables[0].Columns.Add("ECID");
|
||||
ds.Tables[0].Columns.Add("Name");
|
||||
ds.Tables[0].Columns.Add("Format");
|
||||
ds.Tables[0].Columns.Add("Description");
|
||||
|
||||
foreach (var item in lists)
|
||||
{
|
||||
var row = ds.Tables[0].NewRow();
|
||||
row[0] = id++;
|
||||
row[1] = item.PathName;
|
||||
row[2] = item.Type;
|
||||
row[3] = item.Description;
|
||||
ds.Tables[0].Rows.Add(row);
|
||||
}
|
||||
|
||||
if (!ExcelHelper.ExportToExcel(dlg.FileName, ds, out string reason))
|
||||
{
|
||||
MessageBox.Show($"Export failed, {reason}", "Export", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show($"Export succeed, file save as {dlg.FileName}", "Export", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
|
||||
private void PerformExportAlid(object obj)
|
||||
{
|
||||
var lists = AdsDicPlcIndex.DicAlarmNotify;
|
||||
int id = 70001;
|
||||
|
||||
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
|
||||
dlg.DefaultExt = ".xlsx"; // Default file extension
|
||||
dlg.FileName = $"AlarmID_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
dlg.Filter = "Excel数据表格文件(*.xlsx)|*.xlsx"; // Filter files by extension
|
||||
bool? result = dlg.ShowDialog();// Show open file dialog box
|
||||
|
||||
if (result == true)
|
||||
{
|
||||
System.Data.DataSet ds = new System.Data.DataSet();
|
||||
ds.Tables.Add(new System.Data.DataTable("ALID(AlarmID)"));
|
||||
ds.Tables[0].Columns.Add("ALID");
|
||||
ds.Tables[0].Columns.Add("Name");
|
||||
ds.Tables[0].Columns.Add("Description");
|
||||
ds.Tables[0].Columns.Add("EventSet");
|
||||
ds.Tables[0].Columns.Add("EventClear");
|
||||
|
||||
foreach (var item in lists)
|
||||
{
|
||||
var row = ds.Tables[0].NewRow();
|
||||
row[0] = id++;
|
||||
row[1] = item.Value[0];
|
||||
row[2] = item.Value[1];
|
||||
row[3] = 100001;
|
||||
row[4] = 200001;
|
||||
ds.Tables[0].Rows.Add(row);
|
||||
}
|
||||
|
||||
if (!ExcelHelper.ExportToExcel(dlg.FileName, ds, out string reason))
|
||||
{
|
||||
MessageBox.Show($"Export failed, {reason}", "Export", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show($"Export succeed, file save as {dlg.FileName}", "Export", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
|
||||
private void PerformExportSvid(object obj)
|
||||
{
|
||||
var dataList = Singleton<DataManager>.Instance.BuiltInDataList;
|
||||
|
||||
var lists = dataList.Where(m => m.StartsWith("PM")).OrderBy(m => m).ToList();
|
||||
|
||||
int pm1Id = 10001;
|
||||
int pm2Id = 20001;
|
||||
int pm3Id = 30001;
|
||||
int pm4Id = 40001;
|
||||
|
||||
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
|
||||
dlg.DefaultExt = ".xlsx"; // Default file extension
|
||||
dlg.FileName = $"Chamber_Status_Variable_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
dlg.Filter = "Excel数据表格文件(*.xlsx)|*.xlsx"; // Filter files by extension
|
||||
bool? result = dlg.ShowDialog();// Show open file dialog box
|
||||
|
||||
if (result == true)
|
||||
{
|
||||
System.Data.DataSet ds = new System.Data.DataSet();
|
||||
|
||||
ds.Tables.Add(new System.Data.DataTable("SVID(Chamber Status Variable)"));
|
||||
ds.Tables[0].Columns.Add("SVID");
|
||||
ds.Tables[0].Columns.Add("Name");
|
||||
ds.Tables[0].Columns.Add("Format");
|
||||
ds.Tables[0].Columns.Add("Description");
|
||||
|
||||
foreach (var item in lists)
|
||||
{
|
||||
var row = ds.Tables[0].NewRow();
|
||||
|
||||
if (item.StartsWith("PM1"))
|
||||
row[0] = pm1Id++;
|
||||
else if (item.StartsWith("PM2"))
|
||||
row[0] = pm2Id++;
|
||||
else if (item.StartsWith("PM3"))
|
||||
row[0] = pm3Id++;
|
||||
else if (item.StartsWith("PM4"))
|
||||
row[0] = pm4Id++;
|
||||
|
||||
row[1] = item;
|
||||
row[2] = "Ascii";
|
||||
|
||||
var arr = item.Split('.');
|
||||
for (int i = 0; i < arr.Length; i++)
|
||||
row[3] += $"{arr[i]} ";
|
||||
|
||||
ds.Tables[0].Rows.Add(row);
|
||||
}
|
||||
|
||||
if (!ExcelHelper.ExportToExcel(dlg.FileName, ds, out string reason))
|
||||
{
|
||||
MessageBox.Show($"Export failed, {reason}", "Export", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show($"Export succeed, file save as {dlg.FileName}", "Export", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
|
||||
private void PerformExportTMSvid(object obj)
|
||||
{
|
||||
var dataList = Singleton<DataManager>.Instance.BuiltInDataList;
|
||||
|
||||
var tmLists = dataList.Where(m => !m.StartsWith("PM")).OrderBy(m => m).ToList();
|
||||
|
||||
int tmId = 5001;
|
||||
|
||||
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
|
||||
dlg.DefaultExt = ".xlsx"; // Default file extension
|
||||
dlg.FileName = $"TM_Status_Variable_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
dlg.Filter = "Excel数据表格文件(*.xlsx)|*.xlsx"; // Filter files by extension
|
||||
bool? result = dlg.ShowDialog();// Show open file dialog box
|
||||
|
||||
if (result == true)
|
||||
{
|
||||
System.Data.DataSet ds = new System.Data.DataSet();
|
||||
|
||||
ds.Tables.Add(new System.Data.DataTable("SVID(TM Status Variable)"));
|
||||
ds.Tables[0].Columns.Add("SVID");
|
||||
ds.Tables[0].Columns.Add("Name");
|
||||
ds.Tables[0].Columns.Add("Format");
|
||||
ds.Tables[0].Columns.Add("Description");
|
||||
|
||||
foreach (var item in tmLists)
|
||||
{
|
||||
var row = ds.Tables[0].NewRow();
|
||||
row[0] = tmId++;
|
||||
row[1] = item;
|
||||
row[2] = "Ascii";
|
||||
|
||||
var arr = item.Split('.');
|
||||
for (int i = 0; i < arr.Length; i++)
|
||||
row[3] += $"{arr[i]} ";
|
||||
|
||||
ds.Tables[0].Rows.Add(row);
|
||||
}
|
||||
|
||||
if (!ExcelHelper.ExportToExcel(dlg.FileName, ds, out string reason))
|
||||
{
|
||||
MessageBox.Show($"Export failed, {reason}", "Export", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show($"Export succeed, file save as {dlg.FileName}", "Export", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AdsDicPlcIndex
|
||||
{
|
||||
#region Dictionary
|
||||
|
||||
// Alarm Info
|
||||
public static Dictionary<int, string[]> DicAlarmNotify = new Dictionary<int, string[]>()
|
||||
{
|
||||
{ 1, new string[]{ "NH3SolubeDetectAlarm", "NH3 Solube Detect Alarm" }},
|
||||
{ 2, new string[]{ "O3SolubeDetectAlarm", "O3 Solube Detect Alarm" }},
|
||||
{ 3, new string[]{ "Res1SolubeDetectAlarm", "Res1 Solube Detect Alarm" }},
|
||||
{ 4, new string[]{ "Res2SolubeDetectAlarm", "Res2 Solube Detect Alarm" }},
|
||||
{ 5, new string[]{ "DetectorAlarm", "Detector Alarm" }},
|
||||
{ 6, new string[]{ "LiftHandleStop", "Lift Handle Stop" }},
|
||||
{ 7, new string[]{ "CDAPresDetect", "CDA Pressure Detect" }},
|
||||
{ 8, new string[]{ "PMStop", "PM Stop" }},
|
||||
{ 9, new string[]{ "O2PresSwitch", "O2 Pressure Switch" }},
|
||||
{ 10, new string[]{ "N2PresSwitch", "N2 Pressure Switch" }},
|
||||
{ 11, new string[]{ "NH3PresSwitch", "NH3 Pressure Switch" }},
|
||||
{ 12, new string[]{ "EndPresSwitch", "End Pressure Switch" }},
|
||||
{ 13, new string[]{ "HeadMagneticClose", "Head Magnetic Close" }},
|
||||
{ 14, new string[]{ "HeadMagneticOpen", "Head Magnetic Open" }},
|
||||
{ 15, new string[]{ "ChamBackTempSwitch", "Chamber Back Temp Switch" }},
|
||||
{ 16, new string[]{ "ChamLeftUpTempSwitch", "Chamber Left Up Temp Switch" }},
|
||||
{ 17, new string[]{ "ChamLeftDownTempSwitch", "Chamber Left Down Temp Switch" }},
|
||||
{ 18, new string[]{ "ChamRightUpTempSwitch", "Chamber Right Up Temp Switch" }},
|
||||
{ 19, new string[]{ "ChamRightDownTempSwitch", "Chamber Right Down Temp Switch" }},
|
||||
{ 20, new string[]{ "ChamResTempSwitch", "Chamber Reserve Temp Switch" }},
|
||||
{ 21, new string[]{ "WaterLeakDetect", "Water Leak Detect" }},
|
||||
{ 22, new string[]{ "WaterVlvLeakDetect", "Water Valve Leak Detect" }},
|
||||
{ 23, new string[]{ "GasBox1SafeDoor", "GasBox1 Safe Door" }},
|
||||
{ 24, new string[]{ "GasBox2SafeDoor", "GasBox2 Safe Door" }},
|
||||
{ 25, new string[]{ "GasBox3SafeDoor", "GasBox3 Safe Door" }},
|
||||
{ 26, new string[]{ "GasBox4SafeDoor", "GasBox4 Safe Door" }},
|
||||
{ 27, new string[]{ "PMPumpNotRun", "PM Pump Not Run" }},
|
||||
{ 28, new string[]{ "ScrubberAlarm", "Scrubber Alarm" }},
|
||||
{ 29, new string[]{ "SternRowPressureSwitchAlarm", "Stern Row Pressure Switch Alarm" }},
|
||||
{ 30, new string[]{ "", "" }},
|
||||
{ 31, new string[]{ "TubeHeatTempSwitch1", "Tube Heat Temp Switch 1" }},
|
||||
{ 32, new string[]{ "TubeHeatTempSwitch2", "Tube Heat Temp Switch 2" }},
|
||||
{ 33, new string[]{ "TubeHeatTempSwitch3", "Tube Heat Temp Switch 3" }},
|
||||
{ 34, new string[]{ "TubeHeatTempSwitch4", "Tube Heat Temp Switch 4" }},
|
||||
{ 35, new string[]{ "TubeHeatTempSwitch5", "Tube Heat Temp Switch 5" }},
|
||||
{ 36, new string[]{ "TubeHeatTempSwitch6", "Tube Heat Temp Switch 6" }},
|
||||
{ 37, new string[]{ "TubeHeatTempSwitch7", "Tube Heat Temp Switch 7" }},
|
||||
{ 38, new string[]{ "TubeHeatTempSwitch8", "Tube Heat Temp Switch 8" }},
|
||||
{ 39, new string[]{ "TubeHeatTempSwitch9", "Tube Heat Temp Switch 9" }},
|
||||
{ 40, new string[]{ "TubeHeatTempSwitch10", "Tube Heat Temp Switch 10" }},
|
||||
{ 41, new string[]{ "", "" }},
|
||||
{ 42, new string[]{ "", "" }},
|
||||
{ 43, new string[]{ "OverVoltProtect", "Over Volt Protect" }},
|
||||
{ 44, new string[]{ "UndVoltLacPhaRevPhaProtect", "Under Volt, Lack Phase, Reverse Phase Protect" }},
|
||||
{ 45, new string[]{ "", "" }},
|
||||
{ 46, new string[]{ "O3GeneratorAlarm", "O3 Generator Alarm" }},
|
||||
{ 47, new string[]{ "PMVacPumpAlarm", "PM Vacuum Pump Alarm" }},
|
||||
{ 48, new string[]{ "ChuckServoAlarm", "Chuck Servo Alarm" }},
|
||||
{ 49, new string[]{ "", "" }},
|
||||
{ 50, new string[]{ "ChuckLiftUpperLimit", "Chuck Lift Upper Limit" }},
|
||||
{ 51, new string[]{ "ChuckLiftLowerLimit", "Chuck Lift Lower Limit" }},
|
||||
{ 52, new string[]{ "V1OpenAlarm", "Angle Valve V1 Open Alarm" }},
|
||||
{ 53, new string[]{ "V1CloseAlarm", "Angle Valve V1 Close Alarm" }},
|
||||
{ 54, new string[]{ "V3OpenAlarm", "Angle Valve V3 Open Alarm" }},
|
||||
{ 55, new string[]{ "V3CloseAlarm", "Angle Valve V3 Close Alarm" }},
|
||||
{ 56, new string[]{ "V4OpenAlarm", "Angle Valve V4 Open Alarm" }},
|
||||
{ 57, new string[]{ "V4CloseAlarm", "Angle Valve V4 Close Alarm" }},
|
||||
{ 58, new string[]{ "1#SourceLiquidLevelHH", "1# Source Liquid Level HH" }},
|
||||
{ 59, new string[]{ "1#SourceLiquidLevelLL", "1# Source Liquid Level LL" }},
|
||||
{ 60, new string[]{ "2#SourceLiquidLevelHH", "2# Source Liquid Level HH" }},
|
||||
{ 61, new string[]{ "2#SourceLiquidLevelLL", "2# Source Liquid Level LL" }},
|
||||
{ 62, new string[]{ "3#SourceLiquidLevelHH", "3# Source Liquid Level HH" }},
|
||||
{ 63, new string[]{ "3#SourceLiquidLevelLL", "3# Source Liquid Level LL" }},
|
||||
{ 64, new string[]{ "4#SourceLiquidLevelHH", "4# Source Liquid Level HH" }},
|
||||
{ 65, new string[]{ "4#SourceLiquidLevelLL", "4# Source Liquid Level LL" }},
|
||||
{ 66, new string[]{ "TC01SprayHeaterThermoCp", "TC01 Spray Heater Thermo Cp" }},
|
||||
{ 67, new string[]{ "TC02BottomRingThermoCp", "TC02 Bottom Ring Thermo Cp", }},
|
||||
{ 68, new string[]{ "TC03BottomAssistThermoCp", "TC03 Bottom Assist Thermo Cp" }},
|
||||
{ 69, new string[]{ "TC04WaferHeaterThermoCpA", "TC04 Wafer Heater Thermo CpA" }},
|
||||
{ 70, new string[]{ "TC05WaferHeaterThermoCpB", "TC05 Wafer Heater Thermo CpB" }},
|
||||
{ 71, new string[]{ "TC06WaferHeaterThermoCpC", "TC06 Wafer Heater Thermo CpC" }},
|
||||
{ 72, new string[]{ "TC07WaferHeaterThermoCpD", "TC07 Wafer Heater Thermo CpD" }},
|
||||
{ 73, new string[]{ "TC08GasHeaterAThermoCp", "TC08GasHeaterAThermoCp" }},
|
||||
{ 74, new string[]{ "TC09GasHeaterBThermoCp", "TC09GasHeaterBThermoCp" }},
|
||||
{ 75, new string[]{ "TC10ChamTempAThermoCp", "TC10 Chamber TempA Thermo Cp" }},
|
||||
{ 76, new string[]{ "TC11ChamTempBThermoCp", "TC11 Chamber TempB Thermo Cp" }},
|
||||
{ 77, new string[]{ "TC12ChamTempCThermoCp", "TC12 Chamber TempC Thermo Cp" }},
|
||||
{ 78, new string[]{ "TC13ChamTempDThermoCp", "TC13 Chamber TempD Thermo Cp" }},
|
||||
{ 79, new string[]{ "TC14ChamTempEThermoCp", "TC14 Chamber TempE Thermo Cp" }},
|
||||
{ 80, new string[]{ "TC15ChamTempFThermoCp", "TC15 Chamber TempF Thermo Cp" }},
|
||||
{ 81, new string[]{ "TC16ChamTempGThermoCp", "TC16 Chamber TempG Thermo Cp" }},
|
||||
{ 82, new string[]{ "TC17ChamTempHThermoCp", "TC17 Chamber TempH Thermo Cp" }},
|
||||
{ 83, new string[]{ "TC18ChamTempIThermoCp", "TC18 Chamber TempI Thermo Cp" }},
|
||||
{ 84, new string[]{ "TC19ChamTempJThermoCp", "TC19 Chamber TempJ Thermo Cp" }},
|
||||
{ 85, new string[]{ "TC20ChamTempKThermoCp", "TC20 Chamber TempK Thermo Cp" }},
|
||||
{ 86, new string[]{ "TC21ChamTempLThermoCp", "TC21 Chamber TempL Thermo Cp" }},
|
||||
{ 87, new string[]{ "TC25PipeHeatThermoCpCH1", "TC25 Pipe Heat Thermo Cp CH1" }},
|
||||
{ 88, new string[]{ "TC26PipeHeatThermoCpCH2", "TC26 Pipe Heat Thermo Cp CH2" }},
|
||||
{ 89, new string[]{ "TC27PipeHeatThermoCpCH3", "TC27 Pipe Heat Thermo Cp CH3" }},
|
||||
{ 90, new string[]{ "TC28PipeHeatThermoCpCH4", "TC28 Pipe Heat Thermo Cp CH4" }},
|
||||
{ 91, new string[]{ "TC29PipeHeatThermoCpCH5", "TC29 Pipe Heat Thermo Cp CH5" }},
|
||||
{ 92, new string[]{ "TC30PipeHeatThermoCpCH6", "TC30 Pipe Heat Thermo Cp CH6" }},
|
||||
{ 93, new string[]{ "TC31PipeHeatThermoCpCH7", "TC31 Pipe Heat Thermo Cp CH7" }},
|
||||
{ 94, new string[]{ "TC32PipeHeatThermoCpCH8", "TC32 Pipe Heat Thermo Cp CH8" }},
|
||||
{ 95, new string[]{ "TC33PipeHeatThermoCpCH9", "TC33 Pipe Heat Thermo Cp CH9" }},
|
||||
{ 96, new string[]{ "TC34PipeHeatThermoCpCH10", "TC34 Pipe Heat Thermo Cp CH10" }},
|
||||
{ 97, new string[]{ "TC35PipeHeatThermoCpCH11", "TC35 Pipe Heat Thermo Cp CH11" }},
|
||||
{ 98, new string[]{ "TC36PipeHeatThermoCpCH12", "TC36 Pipe Heat Thermo Cp CH12" }},
|
||||
{ 99, new string[]{ "TC37PipeHeatThermoCpCH13", "TC37 Pipe Heat Thermo Cp CH13" }},
|
||||
{ 100, new string[]{ "TC38PipeHeatThermoCpCH14", "TC38 Pipe Heat Thermo Cp CH14" }},
|
||||
{ 101, new string[]{ "TC39PipeHeatThermoCpCH15", "TC39 Pipe Heat Thermo Cp CH15" }},
|
||||
{ 102, new string[]{ "TC40PipeHeatThermoCpCH16", "TC40 Pipe Heat Thermo Cp CH16" }},
|
||||
{ 103, new string[]{ "TC41PipeHeatThermoCpCH17", "TC41 Pipe Heat Thermo Cp CH17" }},
|
||||
{ 104, new string[]{ "TC42PipeHeatThermoCpCH18", "TC42 Pipe Heat Thermo Cp CH18" }},
|
||||
{ 105, new string[]{ "TC43PipeHeatThermoCpCH19", "TC43 Pipe Heat Thermo Cp CH19" }},
|
||||
{ 106, new string[]{ "TC44PipeHeatThermoCpCH20", "TC44 Pipe Heat Thermo Cp CH20" }},
|
||||
{ 107, new string[]{ "TC45BaSucHeat1ThermoCpCH21", "TC45 BaSuc Heat1 Thermo Cp CH21" }},
|
||||
{ 108, new string[]{ "TC46BaSucHeat2ThermoCpCH22", "TC46 BaSuc Heat2 Thermo Cp CH22" }},
|
||||
{ 109, new string[]{ "TC47BaSucHeat3ThermoCpCH23", "TC47 BaSuc Heat3 Thermo Cp CH23" }},
|
||||
{ 110, new string[]{ "TC49AngleValveHeaterAThermoCp", "TC49 Angle Valve HeaterA Thermo Cp" }},
|
||||
{ 111, new string[]{ "TC50AngleValveHeaterBThermoCp", "TC50 Angle Valve HeaterB Thermo Cp" }},
|
||||
{ 112, new string[]{ "TC51AngleValveHeaterCThermoCp", "TC51 Angle Valve HeaterC Thermo Cp" }},
|
||||
{ 113, new string[]{ "", "" }},
|
||||
{ 114, new string[]{ "TC53Source1ThermoCp", "TC53 Source1 Thermo Cp" }},
|
||||
{ 115, new string[]{ "TC54Source2ThermoCp", "TC54 Source2 Thermo Cp" }},
|
||||
{ 116, new string[]{ "TC55Source3ThermoCp", "TC55 Source3 Thermo Cp" }},
|
||||
{ 117, new string[]{ "TC56Source4ThermoCp", "TC56 Source4 Thermo Cp" }},
|
||||
{ 118, new string[]{ "CoolWaterTemp1", "Cool Water Temp1" }},
|
||||
{ 119, new string[]{ "CoolWaterTemp2", "Cool Water Temp2" }},
|
||||
{ 120, new string[]{ "CoolWaterTemp3", "Cool Water Temp3" }},
|
||||
{ 121, new string[]{ "CoolWaterTemp4", "Cool Water Temp4" }},
|
||||
{ 122, new string[]{ "CoolWaterTemp5", "Cool Water Temp5" }},
|
||||
{ 123, new string[]{ "CoolWaterTemp6", "Cool Water Temp6" }},
|
||||
{ 124, new string[]{ "CoolWaterTemp7", "Cool Water Temp7" }},
|
||||
{ 125, new string[]{ "CoolWaterTemp8", "Cool Water Temp8" }},
|
||||
{ 126, new string[]{ "CoolWaterFlowDetect1", "Cool Water Flow Detect1" }},
|
||||
{ 127, new string[]{ "CoolWaterFlowDetect2", "Cool Water Flow Detect2" }},
|
||||
{ 128, new string[]{ "CoolWaterFlowDetect3", "Cool Water Flow Detect3" }},
|
||||
{ 129, new string[]{ "CoolWaterFlowDetect4", "Cool Water Flow Detect4" }},
|
||||
{ 130, new string[]{ "CoolWaterFlowDetect5", "Cool Water Flow Detect5" }},
|
||||
{ 131, new string[]{ "CoolWaterFlowDetect6", "Cool Water Flow Detect6" }},
|
||||
{ 132, new string[]{ "CoolWaterFlowDetect7", "Cool Water Flow Detect7" }},
|
||||
{ 133, new string[]{ "CoolWaterFlowDetect8", "Cool Water Flow Detect8" }},
|
||||
{ 134, new string[]{ "", "" }},
|
||||
{ 135, new string[]{ "MFC1FlowAlarm", "MFC1 Flow Alarm" }},
|
||||
{ 136, new string[]{ "MFC2FlowAlarm", "MFC2 Flow Alarm" }},
|
||||
{ 137, new string[]{ "MFC3FlowAlarm", "MFC3 Flow Alarm" }},
|
||||
{ 138, new string[]{ "MFC4FlowAlarm", "MFC4 Flow Alarm" }},
|
||||
{ 139, new string[]{ "MFC5FlowAlarm", "MFC5 Flow Alarm" }},
|
||||
{ 140, new string[]{ "MFC6FlowAlarm", "MFC6 Flow Alarm" }},
|
||||
{ 141, new string[]{ "MFC7FlowAlarm", "MFC7 Flow Alarm" }},
|
||||
{ 142, new string[]{ "MFC8FlowAlarm", "MFC8 Flow Alarm" }},
|
||||
{ 143, new string[]{ "MFC9FlowAlarm", "MFC9 Flow Alarm" }},
|
||||
{ 144, new string[]{ "MFC10FlowAlarm", "MFC10 Flow Alarm" }},
|
||||
{ 145, new string[]{ "MFC11FlowAlarm", "MFC11 Flow Alarm" }},
|
||||
{ 146, new string[]{ "", "" }},
|
||||
{ 147, new string[]{ "1#SubStationCommFail", "1# Substation Communication Failure" }},
|
||||
{ 148, new string[]{ "2#SubStationCommFail", "2# Substation Communication Failure" }},
|
||||
{ 149, new string[]{ "3#SubStationCommFail", "3# Substation Communication Failure" }},
|
||||
{ 150, new string[]{ "4#SubStationCommFail", "4# Substation Communication Failure" }},
|
||||
{ 151, new string[]{ "5#SubStationCommFail", "5# Substation Communication Failure" }},
|
||||
{ 152, new string[]{ "6#SubStationCommFail", "6# Substation Communication Failure" }},
|
||||
{ 153, new string[]{ "7#SubStationCommFail", "7# Substation Communication Failure" }},
|
||||
{ 154, new string[]{ "8#SubStationCommFail", "8# Substation Communication Failure" }},
|
||||
{ 155, new string[]{ "9#SubStationCommFail", "9# Substation Communication Failure" }},
|
||||
{ 156, new string[]{ "10#SubStationCommFail", "10# Substation Communication Failure" }},
|
||||
{ 157, new string[]{ "11#SubStationCommFail", "11# Substation Communication Failure" }},
|
||||
{ 158, new string[]{ "12#SubStationCommFail", "12# Substation Communication Failure" }},
|
||||
{ 159, new string[]{ "13#SubStationCommFail", "13# Substation Communication Failure" }},
|
||||
{ 160, new string[]{ "14#SubStationCommFail", "14# Substation Communication Failure" }},
|
||||
{ 161, new string[]{ "15#SubStationCommFail", "15# Substation Communication Failure" }},
|
||||
{ 162, new string[]{ "16#SubStationCommFail", "16# Substation Communication Failure" }},
|
||||
{ 163, new string[]{ "17#SubStationCommFail", "17# Substation Communication Failure" }},
|
||||
{ 164, new string[]{ "18#SubStationCommFail", "18# Substation Communication Failure" }},
|
||||
{ 165, new string[]{ "19#SubStationCommFail", "19# Substation Communication Failure" }},
|
||||
{ 166, new string[]{ "20#SubStationCommFail", "20# Substation Communication Failure" }},
|
||||
{ 167, new string[]{ "21#SubStationCommFail", "21# Substation Communication Failure" }},
|
||||
{ 168, new string[]{ "22#SubStationCommFail", "22# Substation Communication Failure" }},
|
||||
{ 169, new string[]{ "23#SubStationCommFail", "23# Substation Communication Failure" }},
|
||||
{ 170, new string[]{ "24#SubStationCommFail", "24# Substation Communication Failure" }},
|
||||
{ 171, new string[]{ "25#SubStationCommFail", "25# Substation Communication Failure" }},
|
||||
{ 172, new string[]{ "26#SubStationCommFail", "26# Substation Communication Failure" }},
|
||||
{ 173, new string[]{ "27#SubStationCommFail", "27# Substation Communication Failure" }},
|
||||
{ 174, new string[]{ "28#SubStationCommFail", "28# Substation Communication Failure" }},
|
||||
{ 175, new string[]{ "29#SubStationCommFail", "29# Substation Communication Failure" }},
|
||||
{ 176, new string[]{ "30#SubStationCommFail", "30# Substation Communication Failure" }},
|
||||
{ 177, new string[]{ "31#SubStationCommFail", "31# Substation Communication Failure" }},
|
||||
{ 178, new string[]{ "32#SubStationCommFail", "32# Substation Communication Failure" }},
|
||||
{ 179, new string[]{ "33#SubStationCommFail", "33# Substation Communication Failure" }},
|
||||
{ 180, new string[]{ "34#SubStationCommFail", "34# Substation Communication Failure" }},
|
||||
{ 181, new string[]{ "PumpTimeoutAlarm", "Pump Vacuum Timeout Alarm" }},
|
||||
{ 182, new string[]{ "VentTimeoutAlarm", "Vent Vacuum Timeout Alarm" }},
|
||||
{ 183, new string[]{ "ChuckPosAlarm", "Chuck Position Exception Alarm" }},
|
||||
{ 184, new string[]{ "ProcessTempTimeoutAlarm", "Process Temp Check Timeout Alarm" }},
|
||||
{ 185, new string[]{ "ProcessPresHighAlarm", "Process Pressure High Exception Alarm" }},
|
||||
{ 186, new string[]{ "ChamPresSwitchVS20", "Chamber Pressure Switch VS20 Exception" }},
|
||||
{ 187, new string[]{ "", "" }},
|
||||
{ 188, new string[]{ "", "" }},
|
||||
{ 189, new string[]{ "", "" }},
|
||||
{ 190, new string[]{ "", "" }},
|
||||
{ 191, new string[]{ "TC45PipeHeatThermoCpCH21", "TC45 Pipe Heat Thermo Cp CH21" }},
|
||||
{ 192, new string[]{ "TC46PipeHeatThermoCpCH22", "TC46 Pipe Heat Thermo Cp CH22" }},
|
||||
{ 193, new string[]{ "TC47PipeHeatThermoCpCH23", "TC47 Pipe Heat Thermo Cp CH23" }},
|
||||
{ 194, new string[]{ "TC48PipeHeatThermoCpCH24", "TC48 Pipe Heat Thermo Cp CH24" }},
|
||||
{ 195, new string[]{ "TC49PipeHeatThermoCpCH25", "TC49 Pipe Heat Thermo Cp CH25" }},
|
||||
{ 196, new string[]{ "TC50PipeHeatThermoCpCH26", "TC50 Pipe Heat Thermo Cp CH26" }},
|
||||
{ 197, new string[]{ "TC51PipeHeatThermoCpCH27", "TC51 Pipe Heat Thermo Cp CH27" }},
|
||||
{ 198, new string[]{ "TC52PipeHeatThermoCpCH28", "TC52 Pipe Heat Thermo Cp CH28" }},
|
||||
{ 199, new string[]{ "TC53PipeHeatThermoCpCH29", "TC53 Pipe Heat Thermo Cp CH29" }},
|
||||
{ 200, new string[]{ "TC54PipeHeatThermoCpCH30", "TC54 Pipe Heat Thermo Cp CH30" }},
|
||||
{ 201, new string[]{ "TC55PipeHeatThermoCpCH31", "TC55 Pipe Heat Thermo Cp CH31" }},
|
||||
{ 202, new string[]{ "TC56PipeHeatThermoCpCH32", "TC56 Pipe Heat Thermo Cp CH32" }},
|
||||
{ 203, new string[]{ "TC57PipeHeatThermoCpCH33", "TC57 Pipe Heat Thermo Cp CH33" }},
|
||||
};
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<Window x:Class="MECF.Framework.RT.Core.Backend.BackendMainView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:MECF.Framework.RT.Core.Backend"
|
||||
mc:Ignorable="d" WindowStartupLocation="CenterScreen" Width="1024" Height="768"
|
||||
Icon="pack://application:,,,/MECF.Framework.RT.Core;component/Resources/default_rt.ico"
|
||||
d:DesignHeight="768" d:DesignWidth="1024">
|
||||
<Window.Resources>
|
||||
|
||||
<Style x:Key="defaultTab" TargetType="{x:Type TabItem}" >
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TabItem}">
|
||||
<Grid>
|
||||
<Border Name="Border" Margin="3" Background="Transparent" BorderBrush="Black" >
|
||||
<ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True">
|
||||
<ContentPresenter.LayoutTransform>
|
||||
<RotateTransform Angle="0" />
|
||||
</ContentPresenter.LayoutTransform>
|
||||
</ContentPresenter>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Panel.ZIndex" Value="100"/>
|
||||
<Setter TargetName="Border" Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#d0e5f7" Offset="0"/>
|
||||
<GradientStop Color="#48b0e2" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="Border" Property="Background" Value="Silver"/>
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="Black" />
|
||||
<Setter Property="Foreground" Value="DarkGray"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
|
||||
<TabControl Name="tab" TabStripPlacement="Top">
|
||||
<!--<TabControl.Resources>
|
||||
<Style TargetType="{x:Type TabItem}">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Margin" Value="5,0,5,0" />
|
||||
|
||||
<Setter Property="HeaderTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<Border x:Name="grid" CornerRadius="5,5,0,0" Background="Silver" Width="150" >
|
||||
<ContentPresenter Content="{TemplateBinding Content}" Margin="15,5,15,5" HorizontalAlignment="Center">
|
||||
<ContentPresenter.LayoutTransform>
|
||||
<RotateTransform Angle="0"/>
|
||||
</ContentPresenter.LayoutTransform>
|
||||
</ContentPresenter>
|
||||
</Border>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type TabItem}},Path=IsSelected}" Value="True">
|
||||
<Setter TargetName="grid" Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#d0e5f7" Offset="0"/>
|
||||
<GradientStop Color="#48b0e2" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</TabControl.Resources>-->
|
||||
|
||||
|
||||
</TabControl>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MECF.Framework.RT.Core.Backend
|
||||
{
|
||||
/// <summary>
|
||||
/// BackendMainView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class BackendMainView : Window
|
||||
{
|
||||
public BackendMainView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Closing += BackendMainView_Closing;
|
||||
}
|
||||
|
||||
private void BackendMainView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
Hide();
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
public void AddItem(string header, UserControl uc)
|
||||
{
|
||||
TabItem item = new TabItem {Header = header};
|
||||
|
||||
item.Content = uc;
|
||||
|
||||
tab.Items.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<UserControl x:Class="MECF.Framework.RT.Core.Backend.BackendSCConfigView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:control="clr-namespace:MECF.Framework.UI.Core.Control;assembly=MECF.Framework.UI.Core"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Button HorizontalAlignment="Left" Margin="20,0,0,0" Command="{Binding ReloadCommand}" Content="ReloadA" Width="100" Height="30" ></Button>
|
||||
<control:SCItemEditor Grid.Row="1" ></control:SCItemEditor>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,178 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using Aitex.Core.UI.MVVM;
|
||||
|
||||
namespace MECF.Framework.RT.Core.Backend
|
||||
{
|
||||
public class NotifiableSCConfigItem : SCConfigItem, INotifyPropertyChanged
|
||||
{
|
||||
public string SetPoint { get; set; }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public void InvokePropertyChanged(string propertyName)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
|
||||
public void InvokePropertyChanged()
|
||||
{
|
||||
PropertyInfo[] ps = this.GetType().GetProperties();
|
||||
foreach (PropertyInfo p in ps)
|
||||
{
|
||||
InvokePropertyChanged(p.Name);
|
||||
|
||||
if (p.PropertyType == typeof(ICommand))
|
||||
{
|
||||
DelegateCommand<string> cmd = p.GetValue(this, null) as DelegateCommand<string>;
|
||||
if (cmd != null)
|
||||
cmd.RaiseCanExecuteChanged();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
FieldInfo[] fi = this.GetType().GetFields();
|
||||
foreach (FieldInfo p in fi)
|
||||
{
|
||||
InvokePropertyChanged(p.Name);
|
||||
|
||||
if (p.FieldType == typeof(ICommand))
|
||||
{
|
||||
DelegateCommand<string> cmd = p.GetValue(this) as DelegateCommand<string>;
|
||||
if (cmd != null)
|
||||
cmd.RaiseCanExecuteChanged();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BackendSCConfigViewModel : ViewModelBase
|
||||
{
|
||||
private List<SCConfigItem> _scItems;
|
||||
|
||||
public ObservableCollection<NotifiableSCConfigItem> ScItemList { get; set; }
|
||||
|
||||
public ICommand SetScCommand { get; set; }
|
||||
public ICommand ReloadCommand { get; set; }
|
||||
|
||||
public BackendSCConfigViewModel()
|
||||
{
|
||||
Init();
|
||||
|
||||
SetScCommand = new DelegateCommand<string>(SetSc);
|
||||
ReloadCommand = new DelegateCommand<string>(Reload);
|
||||
}
|
||||
|
||||
private void SetSc(string name)
|
||||
{
|
||||
NotifiableSCConfigItem item = ScItemList.First(x => x.PathName == name);
|
||||
|
||||
if (item.Type != SCConfigType.String.ToString() && string.IsNullOrEmpty(item.SetPoint))
|
||||
return;
|
||||
|
||||
SC.SetItemValue(name, item.SetPoint == null ? "" : item.SetPoint);
|
||||
|
||||
item.BoolValue = SC.GetConfigItem(name).BoolValue;
|
||||
item.IntValue = SC.GetConfigItem(name).IntValue;
|
||||
item.StringValue = SC.GetConfigItem(name).StringValue;
|
||||
item.DoubleValue = SC.GetConfigItem(name).DoubleValue;
|
||||
item.InvokePropertyChanged(nameof(item.Value));
|
||||
}
|
||||
|
||||
public void Reload(string obj)
|
||||
{
|
||||
foreach (var item in ScItemList)
|
||||
{
|
||||
item.BoolValue = SC.GetConfigItem(item.PathName).BoolValue;
|
||||
item.IntValue = SC.GetConfigItem(item.PathName).IntValue;
|
||||
item.StringValue = SC.GetConfigItem(item.PathName).StringValue;
|
||||
item.DoubleValue = SC.GetConfigItem(item.PathName).DoubleValue;
|
||||
item.InvokePropertyChanged(nameof(item.Value));
|
||||
}
|
||||
}
|
||||
|
||||
void Init()
|
||||
{
|
||||
if (_scItems != null)
|
||||
return;
|
||||
{
|
||||
_scItems = SC.GetItemList();
|
||||
|
||||
|
||||
ScItemList = new ObservableCollection<NotifiableSCConfigItem>();
|
||||
foreach (var scItem in _scItems)
|
||||
{
|
||||
|
||||
ScItemList.Add(new NotifiableSCConfigItem()
|
||||
{
|
||||
BoolValue = scItem.BoolValue,
|
||||
Default = scItem.Default,
|
||||
Description = scItem.Description,
|
||||
DoubleValue = scItem.DoubleValue,
|
||||
IntValue = scItem.IntValue,
|
||||
Max = scItem.Max,
|
||||
Min = scItem.Min,
|
||||
Name = scItem.Name,
|
||||
Type = scItem.Type,
|
||||
Tag = scItem.Tag,
|
||||
Parameter = scItem.Parameter,
|
||||
Path = scItem.Path,
|
||||
SetPoint = scItem.Value.ToString(),
|
||||
StringValue = scItem.StringValue,
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SCConfigView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class BackendSCConfigView : UserControl
|
||||
{
|
||||
|
||||
public BackendSCConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Loaded += SCConfigView_Loaded;
|
||||
|
||||
this.IsVisibleChanged += BackendSCConfigView_IsVisibleChanged;
|
||||
}
|
||||
|
||||
private void BackendSCConfigView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (this.DataContext == null)
|
||||
{
|
||||
DataContext = new BackendSCConfigViewModel();
|
||||
}
|
||||
|
||||
(this.DataContext as BackendSCConfigViewModel).Reload(null);
|
||||
}
|
||||
|
||||
private void SCConfigView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext == null)
|
||||
{
|
||||
DataContext = new BackendSCConfigViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<Window x:Class="MECF.Framework.RT.Core.Backend.PassWordView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:MECF.Framework.RT.Core.Backend"
|
||||
mc:Ignorable="d" Icon="pack://application:,,,/MECF.Framework.RT.Core;component/Resources/MyLogoTray.ico"
|
||||
Height="220" Width="380" Title="Backend Login" Background="LightGray" WindowStyle="SingleBorderWindow" WindowStartupLocation="CenterScreen">
|
||||
<Grid HorizontalAlignment="Center" VerticalAlignment="Center" >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="45" ></RowDefinition>
|
||||
<RowDefinition Height="45" ></RowDefinition>
|
||||
<RowDefinition Height="15" ></RowDefinition>
|
||||
<RowDefinition Height="55" ></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="130"></ColumnDefinition>
|
||||
<ColumnDefinition Width="180"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="Account" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBox x:Name="LoginName" Text="admin" Grid.Row="0" Grid.Column="1" Height="30" Margin="5" VerticalContentAlignment="Center" VerticalAlignment="Center" />
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Password" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<PasswordBox x:Name="PasswordBox" Grid.Row="1" Grid.Column="1" Height="30" Margin="5" PasswordChar="*" TextInput="PasswordBox_OnTextInput" PreviewTextInput="PasswordBox_OnPreviewTextInput" PasswordChanged="PasswordBox_OnPasswordChanged" VerticalContentAlignment="Center" VerticalAlignment="Center" />
|
||||
|
||||
<Canvas Grid.Row="2" Grid.ColumnSpan="2" Width="400" Height="10" VerticalAlignment="Top" >
|
||||
<Line Width="500" Height="11" Stroke="White" StrokeThickness="1" X1="-50" Y1="10" X2="390" Y2="10" />
|
||||
</Canvas>
|
||||
|
||||
<StackPanel Grid.Row="3" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Button Content="Login" HorizontalAlignment="Left" Margin="0,15,0,0" Height="25" Grid.Row="2" VerticalAlignment="Top" Width="85" Click="EnsureButton_Click" IsDefault="True"/>
|
||||
<Button Content="Cancel" Grid.Column="1" HorizontalAlignment="Left" Margin="25,15,0,0" Height="25" Grid.Row="2" VerticalAlignment="Top" Width="85" Click="CancelButton_Click"/>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MECF.Framework.RT.Core.Backend
|
||||
{
|
||||
/// <summary>
|
||||
/// PassWord.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PassWordView : Window
|
||||
{
|
||||
public bool VerificationResult { get; set; }
|
||||
|
||||
public PassWordView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Closing += PassWordView_Closing;
|
||||
|
||||
this.Loaded += PassWordView_Loaded;
|
||||
|
||||
this.IsVisibleChanged += PassWordView_IsVisibleChanged;
|
||||
}
|
||||
|
||||
private void PassWordView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (IsVisible)
|
||||
PasswordBox.Focus();
|
||||
}
|
||||
|
||||
private void PassWordView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PasswordBox.Focus();
|
||||
}
|
||||
|
||||
private void PassWordView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void EnsureButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (PasswordBox.Password == "123456" || PasswordBox.Password == "admin")
|
||||
{
|
||||
VerificationResult = true;
|
||||
|
||||
Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
PasswordBox.Foreground = new SolidColorBrush(Colors.Red);
|
||||
VerificationResult = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
PasswordBox.Password = "";
|
||||
VerificationResult = false;
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void PasswordBox_OnPasswordChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PasswordBox.Foreground = new SolidColorBrush(Colors.Black);
|
||||
}
|
||||
|
||||
private void PasswordBox_OnPreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void PasswordBox_OnTextInput(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user