Browse Source

1.添加topview LOG显示功能
2.添加datalog里eventview功能
3.添加部分钟摆阀功能

lixiang 2 years ago
parent
commit
b17ae64e6b

+ 1 - 1
Venus/Framework/Common/Log/LOG.cs

@@ -59,7 +59,7 @@ namespace Aitex.Core.RT.Log
         public static void Write(eEvent id, ModuleName module, params string[] values)
         {
 
-           var logItem= LogDefineManager.LogItems.Where(x => x.Id == id).FirstOrDefault();
+           var logItem= LogDefineManager.LogItems?.Where(x => x.Id == id).FirstOrDefault();
             if (logItem != null)
             {
                 //var item= ((int)logItem.Id).ToString().PadLeft(10);

+ 33 - 0
Venus/Venus_MainPages/Converters/EventItemToStringConverter.cs

@@ -0,0 +1,33 @@
+using Aitex.Core.RT.Event;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Collections.ObjectModel;
+
+namespace Venus_MainPages.Converters
+{
+    public class EventItemToStringConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            var item = (EventItem)value;
+            if (item == null) return null;
+            return item?.OccuringTime.ToString() + "  =>  " + item.Description;
+            //var itemList =  value as ObservableCollection<EventItem>;
+            //ObservableCollection<string> outValue = new ObservableCollection<string>();
+            //itemList.ToList().ForEach(item => 
+            //{
+            // outValue.Add(item?.OccuringTime.ToString() + "  =>  " + item.Description);
+            //});
+            //return outValue;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return null;
+        }
+    }
+}

+ 17 - 0
Venus/Venus_MainPages/Venus_MainPages.csproj

@@ -100,6 +100,7 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Converters\EventItemToStringConverter.cs" />
     <Compile Include="PMS\IUiRecipeManager.cs" />
     <Compile Include="PMS\UiRecipeManager.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -111,7 +112,9 @@
     <Compile Include="Unity\SystemConfig.cs" />
     <Compile Include="Unity\SystemConfigProvider.cs" />
     <Compile Include="Unity\WaferAssociationInfo.cs" />
+    <Compile Include="ViewModels\ButterflyValveViewModel.cs" />
     <Compile Include="ViewModels\DataAnalysisViewModel.cs" />
+    <Compile Include="ViewModels\EventViewModel.cs" />
     <Compile Include="ViewModels\GasLeakCheckViewModel.cs" />
     <Compile Include="ViewModels\GetRtAllData.cs" />
     <Compile Include="ViewModels\IOViewModel.cs" />
@@ -123,9 +126,15 @@
     <Compile Include="ViewModels\RecipeViewModel.cs" />
     <Compile Include="ViewModels\SystemConfigViewModel.cs" />
     <Compile Include="ViewModels\TopViewModel.cs" />
+    <Compile Include="Views\ButterflyValveView.xaml.cs">
+      <DependentUpon>ButterflyValveView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\DataAnalysisView.xaml.cs">
       <DependentUpon>DataAnalysisView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\EventView.xaml.cs">
+      <DependentUpon>EventView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\GasLeakCheckView.xaml.cs">
       <DependentUpon>GasLeakCheckView.xaml</DependentUpon>
     </Compile>
@@ -183,10 +192,18 @@
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
+    <Page Include="Views\ButterflyValveView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\DataAnalysisView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EventView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\GasLeakCheckView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 60 - 0
Venus/Venus_MainPages/ViewModels/ButterflyValveViewModel.cs

@@ -0,0 +1,60 @@
+using MECF.Framework.Common.OperationCenter;
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Venus_MainPages.ViewModels
+{
+    public class ButterflyValveViewModel : BindableBase
+    {
+        #region 私有字段
+        private string ModuleName = "PMA";
+        private bool m_IsPositionMode;
+        private int? m_SetValue;
+        private int? m_FeedBackValue;
+        #endregion
+
+        #region 属性
+        public bool IsPositionMode
+        { 
+        get { return m_IsPositionMode; }
+        set { SetProperty(ref m_IsPositionMode, value); }
+        }
+
+        public int? SetValue
+        {
+            get { return m_SetValue; }
+            set { SetProperty(ref m_SetValue, value); }
+        }
+        public int? FeedBackValue
+        {
+            get { return m_FeedBackValue; }
+            set { SetProperty(ref m_FeedBackValue, value); }
+        }
+        #endregion
+
+        #region 命令
+        private DelegateCommand _SetCommand;
+        public DelegateCommand SetCommand =>
+            _SetCommand ?? (_SetCommand = new DelegateCommand(OnSet));
+        #endregion
+
+        #region 命令方法
+        private void OnSet()
+        {
+            if (IsPositionMode == true)
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetPVPostion",SetValue);
+            }
+            else
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetPVPressure",SetValue);
+            }
+        }
+        #endregion
+    }
+}

+ 374 - 0
Venus/Venus_MainPages/ViewModels/EventViewModel.cs

@@ -0,0 +1,374 @@
+using Aitex.Core.RT.Event;
+using MECF.Framework.Common.DataCenter;
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media.Imaging;
+using Venus_MainPages.Views;
+
+namespace Venus_MainPages.ViewModels
+{
+    public class EventViewModel : BindableBase
+    {
+        #region 私有字段
+        private int MenuPermission;
+        #endregion
+
+        #region 属性
+        public bool SearchAlarmEvent { get; set; }
+        public bool SearchWarningEvent { get; set; }
+        public bool SearchInfoEvent { get; set; }
+        public bool SearchOpeLog { get; set; }
+
+        public bool SearchPMA { get; set; }
+        public bool SearchPMB { get; set; }
+        public bool SearchPMC { get; set; }
+        public bool SearchPMD { get; set; }
+        //public bool SearchCoolDown { get; set; }
+        public bool SearchTM { get; set; }
+        public bool SearchLL { get; set; }
+        //public bool SearchBuf1 { get; set; }
+        public bool SearchSystem { get; set; }
+
+        public string SearchKeyWords { get; set; }
+
+        public DateTime SearchBeginTime { get; set; }
+        public DateTime SearchEndTime { get; set; }
+
+        public string Keywords { get; set; }
+
+        public ObservableCollection<string> EventList { get; set; }
+        public string SelectedEvent { get; set; }
+
+        public ObservableCollection<string> UserList { get; set; }
+        public string SelectedUser { get; set; }
+
+        public ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem> SearchedResult { get; set; }
+
+        public Func<string, List<EventItem>> QueryDBEventFunc { get; set; }
+        public Func<List<string>> QueryEventList { get; set; }
+        #endregion
+
+        #region 命令
+        private DelegateCommand _SearchCommand;
+        public DelegateCommand SearchCommand =>
+            _SearchCommand ?? (_SearchCommand = new DelegateCommand(Search));
+
+        private DelegateCommand _ExportCommand;
+        public DelegateCommand ExportCommand =>
+            _ExportCommand ?? (_ExportCommand = new DelegateCommand(Export));
+
+        private DelegateCommand<object> _LoadCommand;
+        public DelegateCommand<object> LoadCommand =>
+            _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
+        #endregion
+        public EventViewModel()
+        {
+            this.QueryDBEventFunc = (sql) => QueryDataClient.Instance.Service.QueryDBEvent(sql);
+
+            this.QueryEventList = () =>
+            {
+                List<string> result = new List<string>();
+
+                foreach (var eventName in Enum.GetNames(typeof(EventEnum)))
+                    result.Add(eventName);
+
+                return result;
+            };
+
+            var now = DateTime.Today;
+            SearchBeginTime = now;// -new TimeSpan(1, 0, 0, 0);
+            SearchEndTime = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59, 999);
+
+            SelectedUser = "All";
+            SearchKeyWords = string.Empty;
+
+
+            SearchAlarmEvent = true;
+            SearchWarningEvent = true;
+            SearchInfoEvent = true;
+            SearchOpeLog = false;
+
+            SearchPMA = false;
+            SearchPMB = false;
+            SearchPMC = false;
+            SearchPMD = false;
+            //SearchCoolDown = false;
+            SearchTM = false;
+            SearchLL = false;
+            //SearchBuf1 = false;
+            SearchSystem = false;
+
+            
+        }
+
+        #region 方法
+
+        private void OnLoad(Object eventView)
+        {
+            this.view = (EventView)eventView;
+            this.view.wfTimeFrom.Value = this.SearchBeginTime;
+            this.view.wfTimeTo.Value = this.SearchEndTime;
+            this.Preload();
+        }
+        /// <summary>
+        /// 预先载入数据
+        /// </summary>
+        public void Preload()
+        {
+            //初始化所有的枚举事件类型
+            EventList = new ObservableCollection<string>();
+            EventList.Add("All");
+            if (QueryEventList != null)
+            {
+                List<string> evList = QueryEventList();
+                foreach (string ev in evList)
+                    EventList.Add(ev);
+            }
+            SelectedEvent = "All";
+
+            //初始化所有的用户
+            //PreloadUsers();
+
+            //所有属性更新
+            //NotifyOfPropertyChange();
+
+            //第一次默认查询
+            if (SearchedResult == null)
+                Search();
+        }
+
+        /// <summary>
+        /// 导出
+        /// </summary>
+        public void Export()
+        {
+            try
+            {
+                Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
+                dlg.DefaultExt = ".xls"; // Default file extension 
+                dlg.Filter = "Excel数据表格文件(*.xls)|*.xls"; // Filter files by extension 
+                Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
+                if (result == true) // Process open file dialog box results
+                {
+                    System.Data.DataSet ds = new System.Data.DataSet();
+                    ds.Tables.Add(new System.Data.DataTable("系统运行日志"));
+                    ds.Tables[0].Columns.Add("类型");
+                    ds.Tables[0].Columns.Add("时间");
+                    ds.Tables[0].Columns.Add("腔体");
+                    ds.Tables[0].Columns.Add("发起源");
+                    ds.Tables[0].Columns.Add("内容描述");
+                    foreach (var item in SearchedResult)
+                    {
+                        var row = ds.Tables[0].NewRow();
+                        row[0] = item.LogType;
+                        row[1] = item.Time;
+                        row[2] = item.TargetChamber;
+                        row[3] = item.Initiator;
+                        row[4] = item.Detail;
+                        ds.Tables[0].Rows.Add(row);
+                    }
+                    ds.WriteXml(dlg.FileName);
+                }
+            }
+            catch (Exception ex)
+            {
+                //LOG.Write(ex);
+                MessageBox.Show("导出系统日志发生错误", "导出失败", MessageBoxButton.OK, MessageBoxImage.Warning);
+            }
+        }
+
+        private string GetSourceWhere()
+        {
+            //if (!SearchPMA) sqlEvent += string.Format(" and \"Source\"<>'{0}' ", ChamberSet.ReactorA);
+            //if (!SearchPMB) sqlEvent += string.Format(" and \"Source\"<>'{0}' ", ChamberSet.ReactorB);
+            //if (!SearchPMC) sqlEvent += string.Format(" and \"Source\"<>'{0}' ", ChamberSet.ReactorC);
+            //if (!SearchPMD) sqlEvent += string.Format(" and \"Source\"<>'{0}' ", ChamberSet.ReactorD);
+            //if (!SearchSystem) sqlEvent += string.Format(" and \"Source\"<>'{0}' ", ChamberSet.System);
+            //if (!SearchLL) sqlEvent += string.Format(" and \"Source\"<>'{0}' ", ChamberSet.Loadlock);
+            //if (!SearchTM) sqlEvent += string.Format(" and \"Source\"<>'{0}' and \"Source\"<>'{1}' and \"Source\"<>'{2}' ",
+            //    ChamberSet.Loadlock, ChamberSet.Buffer1, ChamberSet.Cooldown);
+
+            return "";
+        }
+
+        /*
+         *gid integer NOT NULL DEFAULT nextval('event_data_gid_seq'::regclass),
+          event_id integer,
+          event_enum text,
+          type text,
+          source text,
+          description text,
+          level text,
+          occur_time timestamp without time zone,
+          CONSTRAINT event_data_pkey PRIMARY KEY (gid)
+         */
+        /// <summary>
+        /// 查询
+        /// </summary>
+        public void Search()
+        {
+            Task.Factory.StartNew(() =>
+            {
+                try
+                {
+                    this.SearchBeginTime = this.view.wfTimeFrom.Value;
+                    this.SearchEndTime = this.view.wfTimeTo.Value;
+
+                    string sqlEvent = "";
+                    string sqlOperationLog = "";
+                    string sql = "";
+
+                    if (SearchAlarmEvent || SearchWarningEvent || SearchInfoEvent)
+                    {
+                        sqlEvent = string.Format("SELECT \"event_id\", \"event_enum\", \"type\", \"occur_time\", \"level\",\"source\" , \"description\" FROM \"event_data\" where \"occur_time\" >='{0}' and \"occur_time\" <='{1}' ", SearchBeginTime.ToString("yyyyMMdd HHmmss"), SearchEndTime.ToString("yyyyMMdd HHmmss"));
+
+                        sqlEvent += GetSourceWhere();
+
+                        sqlEvent += " and (FALSE ";
+                        if (SearchAlarmEvent) sqlEvent += " OR \"level\"='Alarm' ";
+                        if (SearchWarningEvent) sqlEvent += " OR \"level\"='Warning' ";
+                        if (SearchInfoEvent) sqlEvent += " OR \"level\"='Information' ";
+                        sqlEvent += " ) ";
+
+                        if (!string.IsNullOrWhiteSpace(SelectedEvent) && SelectedEvent != "All") sqlEvent += string.Format(" and lower(\"event_enum\")='{0}' ", SelectedEvent.ToLower());
+
+                        //if (!string.IsNullOrWhiteSpace(SearchKeyWords)) sqlEvent += string.Format(" and lower(\"description\") like '%{0}%' ", SearchKeyWords.ToLower());
+                        if (!string.IsNullOrWhiteSpace(SearchKeyWords)) sqlEvent += string.Format(" and lower(\"description\") like '%{0}%' or lower(\"type\") like '%{1}%'", SearchKeyWords.ToLower(), SearchKeyWords.ToLower());
+                    }
+
+                    if (SearchOpeLog)
+                    {
+                        //sqlOperationLog = string.Format(" SELECT \"UserName\" as \"Initiator\", 'UserOperation' as \"LogType\", \"Time\", \"ChamberId\" as \"TargetChamber\", \"Content\" as \"Description\" FROM \"OperationLog\" where \"Time\" >='{0}' and \"Time\" <='{1}' ", SearchBeginTime.ToString("yyyy/MM/dd HH:mm:ss"), SearchEndTime.ToString("yyyy/MM/dd HH:mm:ss"));
+
+                        //if (!SearchPMA) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.ReactorA);
+                        //if (!SearchPMB) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.ReactorB);
+                        //if (!SearchPMC) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.ReactorC);
+                        //if (!SearchPMD) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.ReactorD);
+                        //if (!SearchSystem) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.System);                      
+                        //if (!SearchLL) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.Loadlock);
+                        //if (!SearchTM) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' and \"ChamberId\"<>'{1}' and \"ChamberId\"<>'{2}' ",
+                        //    ChamberSet.Loadlock, ChamberSet.Buffer1, ChamberSet.Cooldown);
+                        //if (!string.IsNullOrWhiteSpace(SelectedUser) && SelectedUser != "不限") sqlOperationLog += string.Format(" and lower(\"UserName\")='{0}' ", SelectedUser.ToLower());
+
+                        //if (!string.IsNullOrWhiteSpace(SearchKeyWords)) sqlOperationLog += string.Format(" and lower(\"Content\") like '%{0}%' ", SearchKeyWords.ToLower());
+                    }
+
+                    sql = sqlEvent;
+
+                    if (!string.IsNullOrEmpty(sqlOperationLog))
+                    {
+                        if (string.IsNullOrEmpty(sql))
+                        {
+                            sql = sqlOperationLog;
+                        }
+                        else
+                        {
+                            sql += " UNION ALL " + sqlOperationLog;
+                        }
+                    }
+
+
+                    if (!string.IsNullOrEmpty(sql) && QueryDBEventFunc != null)
+                    {
+                        sql += " order by \"occur_time\" DESC limit 2000;";
+
+                        List<EventItem> lstEvent = QueryDBEventFunc(sql);
+
+                        if (lstEvent == null)
+                            return;
+
+                        Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+                        {
+                            SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
+
+                            string logTypeStr;
+
+                            foreach (EventItem ev in lstEvent)
+                            {
+                                switch (ev.Level)
+                                {
+                                    case EventLevel.Information: logTypeStr = "Info"; break;
+                                    case EventLevel.Warning: logTypeStr = "Warning"; break;
+                                    case EventLevel.Alarm: logTypeStr = "Alarm"; break;
+                                    default: logTypeStr = "Undefine"; break;
+                                }
+
+
+                                SearchedResult.Add(new Aitex.Core.UI.View.Common.SystemLogItem()
+                                {
+                                    Time = ((DateTime)ev.OccuringTime).ToString("yyyy/MM/dd HH:mm:ss.fff"),
+                                    LogType = logTypeStr,
+                                    Detail = ev.Description,
+                                    TargetChamber = ev.Source,
+                                    Initiator = "",
+                                    Icon = new BitmapImage(new Uri(string.Format("pack://application:,,,/MECF.Framework.Common;component/Resources/SystemLog/{0}.png", ev.Level.ToString()), UriKind.Absolute))
+                                });
+                            }
+                            RaisePropertyChanged("SearchedResult");
+
+                            if (SearchedResult.Count >= 2000)
+                            {
+                                //MessageBox.Show("Only display max 2000 items,reset the query condition", "query too many result", MessageBoxButton.OK, MessageBoxImage.Warning);
+                            }
+
+                        }));
+                    }
+                    else
+                    {
+                        Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+                        {
+                            SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
+                            RaisePropertyChanged("SearchedResult");
+                        }));
+                    }
+                }
+                catch (Exception ex)
+                {
+                    //LOG.Write(ex);
+                }
+            });
+        }
+
+        private EventView view;
+        #endregion
+    }
+    public class SystemLogItem
+    {
+        /// <summary>
+        /// 时间
+        /// </summary>
+        public string Time { get; set; }
+
+        /// <summary>
+        /// ICON 
+        /// </summary>
+        public object Icon { get; set; }
+
+        /// <summary>
+        /// 类型:操作日志|事件|其他
+        /// </summary>
+        public string LogType { get; set; }
+
+        /// <summary>
+        /// 针对腔体
+        /// </summary>
+        public string TargetChamber { get; set; }
+
+        /// <summary>
+        /// 发起方
+        /// </summary>
+        public string Initiator { get; set; }
+
+        /// <summary>
+        /// 详情
+        /// </summary>
+        public string Detail { get; set; }
+    }
+}

+ 51 - 2
Venus/Venus_MainPages/ViewModels/OverViewModel.cs

@@ -1,4 +1,5 @@
 using Aitex.Core.Common.DeviceData;
+using Aitex.Core.RT.Event;
 using Aitex.Core.RT.SCCore;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.OperationCenter;
@@ -14,6 +15,8 @@ using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Threading;
 using Venus_Core;
+using Venus_MainPages.Views;
+using Venus_Themes.UserControls;
 
 namespace Venus_MainPages.ViewModels
 {
@@ -73,6 +76,9 @@ namespace Venus_MainPages.ViewModels
         private List<string> m_RtDataKeys;
         private Dictionary<string, object> m_RtDataValues;
 
+        private int m_PositionValue;
+        private bool m_IsPositionMode;
+
         #endregion
 
         #region  属性      
@@ -265,6 +271,17 @@ namespace Venus_MainPages.ViewModels
             get { return m_SRFIsOn; }
             set { SetProperty(ref m_SRFIsOn, value); }
         }
+
+        public int PositionValue
+        {
+            get { return m_PositionValue; }
+            set { SetProperty(ref m_PositionValue, value); }
+        }
+        public bool IsPositionMode
+        {
+            get { return m_IsPositionMode; }
+            set { SetProperty(ref m_IsPositionMode, value); }
+        }
         #endregion
 
         #region 命令
@@ -325,6 +342,10 @@ namespace Venus_MainPages.ViewModels
         private DelegateCommand _SetBRfCommand;
         public DelegateCommand SetBRfCommand =>
             _SetBRfCommand ?? (_SetBRfCommand = new DelegateCommand(OnSetBRf));
+
+        private DelegateCommand _OpenButterflyValveViewCommand;
+        public DelegateCommand OpenButterflyValveViewCommand =>
+            _OpenButterflyValveViewCommand ?? (_OpenButterflyValveViewCommand = new DelegateCommand(OnOpenButterflyValveView));
         #endregion
 
         #region 构造函数
@@ -346,6 +367,7 @@ namespace Venus_MainPages.ViewModels
             timer.Start();
 
             //GetRtAllData getRtAllData = new GetRtAllData();
+            //IsPositionMode = true;
 
         }
        
@@ -358,7 +380,7 @@ namespace Venus_MainPages.ViewModels
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Home");            
         }
         private void OnGas()
-        {          
+        {
             object[] mfc = new object[8];
             //string[] mfcSetPoint = new string[8];
             for (int index = 0; index < mfc.Length; index++)
@@ -373,7 +395,6 @@ namespace Venus_MainPages.ViewModels
                 //mfc[index] = Convert.ToDouble(string.IsNullOrEmpty(mfcSetPoint[index]) ? "0.0" : mfcSetPoint[index]);
                 //QueryDataClient.Instance.Service.GetConfig()
             }
-
         }
 
         private void OnRf()
@@ -523,6 +544,15 @@ namespace Venus_MainPages.ViewModels
         {
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Abort");
         }
+        private void OnOpenButterflyValveView()
+        {
+            ButterflyValveView butterflyValveMessageBox = new ButterflyValveView();
+            //butterflyValveMessageBox.IsPositionMode = true;
+            butterflyValveMessageBox.WindowStartupLocation = WindowStartupLocation.Manual;
+            butterflyValveMessageBox.Left = 800;
+            butterflyValveMessageBox.Top = 500;
+            butterflyValveMessageBox.ShowDialog();
+        }
         #endregion
 
         #region 私有方法
@@ -569,6 +599,23 @@ namespace Venus_MainPages.ViewModels
             BRFIsOn = (bool)RtDataValues[$"{ModuleName}.BRfIsOn"];
             SRFIsOn = (bool)RtDataValues[$"{ModuleName}.SRfIsOn"];
 
+            if (IsPositionMode == true)
+            {
+                int value= (int)RtDataValues[$"{ModuleName}.GetPVPosition"];
+                if (value >= 100)
+                {
+                    PositionValue = 360;
+                }
+                else
+                { 
+                PositionValue = (int)(((int)RtDataValues[$"{ModuleName}.GetPVPosition"])*3.6);
+                }
+            }
+            else
+            {
+                PositionValue = 90;
+            }
+
 
         }
 
@@ -663,6 +710,8 @@ namespace Venus_MainPages.ViewModels
 
             m_RtDataKeys.Add($"{ModuleName}.TurboPumpRotationalSpeed");
 
+            m_RtDataKeys.Add($"{ModuleName}.GetPVPosition");
+
 
 
 

+ 66 - 6
Venus/Venus_MainPages/ViewModels/TopViewModel.cs

@@ -1,10 +1,14 @@
-using MECF.Framework.Common.DataCenter;
+using Aitex.Core.RT.Event;
+using Aitex.Core.WCF;
+using MECF.Framework.Common.DataCenter;
 using Prism.Commands;
 using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Threading;
@@ -17,10 +21,18 @@ namespace Venus_MainPages.ViewModels
         private string m_Title;
         private string m_SoftwareVersion;
 
-        private List<string> m_RtDataKeys=new List<string> ();
+        private List<string> m_RtDataKeys=new List<string>();
         private Dictionary<string, object> m_RtDataValues;
 
         private string ModuleName;
+
+        //public ObservableCollection<EventItem> m_WarnEventLogList=new ObservableCollection<EventItem> ();
+        private ObservableCollection<EventItem> m_EventLogList = new ObservableCollection<EventItem>();
+        private EventItem m_CurrentEventItem=new EventItem ();
+        private string m_CurrentEventItemValue;
+        private object _lockObj = new object();
+        private int m_EventLogListSelectedIndex;
+
         #endregion
 
         #region  属性
@@ -40,6 +52,35 @@ namespace Venus_MainPages.ViewModels
             get { return m_RtDataValues; }
             set { SetProperty(ref m_RtDataValues, value); }
         }
+
+        //public ObservableCollection<EventItem> WarnEventLogList
+        //{
+        //    get { return m_WarnEventLogList; }
+        //    set { SetProperty(ref m_WarnEventLogList, value); }
+        //}
+
+        public ObservableCollection<EventItem> EventLogList
+        {
+            get { return m_EventLogList; }
+            set { SetProperty(ref m_EventLogList, value); }
+        }
+
+        public EventItem CurrentEventItem
+        {
+            get { return m_CurrentEventItem; }
+            set { SetProperty(ref m_CurrentEventItem, value); }
+        }
+        public int EventLogListSelectedIndex
+        {
+            get { return m_EventLogListSelectedIndex; }
+            set { SetProperty(ref m_EventLogListSelectedIndex, value); }
+        }
+
+        public string CurrentEventItemValue
+        {
+            get { return m_CurrentEventItemValue; }
+            set { SetProperty(ref m_CurrentEventItemValue, value); }
+        }
         #endregion
 
         #region 命令
@@ -60,16 +101,17 @@ namespace Venus_MainPages.ViewModels
             timer.Interval = TimeSpan.FromSeconds(1);
             timer.Tick += timer_Tick;
             timer.Start();
-        }
-        #endregion
 
+            EventClient.Instance.OnEvent += Instance_OnEvent;
+            EventClient.Instance.Start();
 
+        }
+        #endregion
 
         #region 方法
 
         void timer_Tick(object sender, EventArgs e)
         {
-            //RtConfigValues = QueryDataClient.Instance.Service.PollConfig(m_RtConfigKeys);
             RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
         }
 
@@ -109,9 +151,27 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.SignalTower.IsGreenLightOn");
             m_RtDataKeys.Add($"{ModuleName}.SignalTower.IsBlueLightOn");
             m_RtDataKeys.Add($"{ModuleName}.SignalTower.IsBuzzerOn");
+        }
 
+        private void Instance_OnEvent(EventItem eventItem)
+        {
+            //lock (_lockObj)
+            //{
+            //    ThreadPool.QueueUserWorkItem(delegate
+            //    {
+            //        CurrentEventItem = eventItem;
+            //    });
+            //}
 
-
+            
+            Application.Current.Dispatcher.Invoke(delegate
+            {
+                EventLogList.Add(eventItem);
+                CurrentEventItem = eventItem;
+                EventLogListSelectedIndex = EventLogList.Count - 1;
+                //CurrentEventItemValue = eventItem.Description;
+            });
+            
         }
         #endregion
 

+ 64 - 0
Venus/Venus_MainPages/Views/ButterflyValveView.xaml

@@ -0,0 +1,64 @@
+<Window x:Class="Venus_MainPages.Views.ButterflyValveView"
+             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:Venus_MainPages.Views"
+             xmlns:converters="clr-namespace:Venus_Themes.Converters;assembly=Venus_Themes"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             mc:Ignorable="d" 
+             Width="300" Height="350">
+    <Window.Resources>
+        <converters:BoolToValueConverter x:Key="BoolToValueConverter"/>
+        <converters:BoolToBool x:Key="BoolToBool"/>
+        <converters:BoolToUnitConverter x:Key="BoolToUnitConverter"/>
+    </Window.Resources>
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="1*"/>
+            <ColumnDefinition Width="auto"/>
+            <ColumnDefinition Width="auto"/>
+            <ColumnDefinition Width="1*"/>
+        </Grid.ColumnDefinitions>
+        <TextBlock Grid.Row="0" Grid.Column="1" Text="Device Name:"  VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,10,0,0"/>
+        <TextBlock Grid.Row="1" Grid.Column="1" Text="Work Mode:" VerticalAlignment="Center" Block.TextAlignment="Right" />
+        <!--<TextBlock Grid.Row="2" Grid.Column="1" Text="Max:" VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,10,0,0"/>-->
+        <TextBlock Grid.Row="2" Grid.Column="1" Text="Unit:" VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,10,0,0"/>
+        <TextBlock Grid.Row="3" Grid.Column="1" Text="Feedback:" VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,10,0,0"/>
+        <TextBlock Grid.Row="4" Grid.Column="1" Text="Set Point:" VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,10,0,0"/>
+
+        <Label  Grid.Row="0" Grid.Column="2" Content="{Binding Path=DeviceName}" Width="150" Height="28" HorizontalAlignment="Left"  FontSize="13" FontFamily="Arial,SimSun"  BorderThickness="0,0,0,1" BorderBrush="Black"/>
+        <!--<Label Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Left" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="10" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" >
+            
+
+        </Label>-->
+        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="2">
+            <RadioButton x:Name="ckPosition" IsChecked="{Binding IsPositionMode}"   VerticalContentAlignment="Center">Position</RadioButton>
+            <RadioButton x:Name="ckPressure" IsChecked="{Binding IsPositionMode,Converter={StaticResource BoolToBool}}"   Margin="10,0,0,0" VerticalContentAlignment="Center">Pressure</RadioButton>
+        </StackPanel>
+
+        <!--<TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding Path=MaxValuePosition}" Width="150"  FontSize="13" FontFamily="Arial,SimSun" Height="28" />-->
+        <!--<Label Grid.Row="2" Grid.Column="2" VerticalContentAlignment="Bottom" Content="{Binding Path=MaxValuePressure}" Width="150"  FontSize="13" FontFamily="Arial,SimSun" Height="28" BorderThickness="0,0,0,1" BorderBrush="Black"/>-->
+
+        <!--<TextBlock Grid.Row="3" Grid.Column="2" Text="{Binding Path=UnitPosition}" Width="150"       FontSize="13" FontFamily="Arial,SimSun" Height="28" />-->
+        <Label Grid.Row="2" Grid.Column="2" VerticalContentAlignment="Bottom"  Content="{Binding IsPositionMode,Converter={StaticResource BoolToUnitConverter}}" Width="150"       FontSize="13" FontFamily="Arial,SimSun" Height="28" BorderThickness="0,0,0,1" BorderBrush="Black"/>
+
+        <!--<TextBlock Grid.Row="4" Grid.Column="2" Text="{Binding Path=FeedbackPosition}"  FontFamily="Arial,SimSun" Height="28"/>-->
+        <Label Grid.Row="3" Grid.Column="2" VerticalContentAlignment="Bottom" Content="{Binding FeedBackValue}"   Width="150"  FontSize="13" FontFamily="Arial,SimSun" Height="28" BorderThickness="0,0,0,1" BorderBrush="Black"/>
+
+        <!--<TextBox Grid.Row="5" Grid.Column="2" x:Name="inputBoxPosition" BorderBrush="Green" BorderThickness="0,0,0,1"  Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center"/>-->
+        <TextBox Grid.Row="4" Grid.Column="2"   Text="{Binding SetValue}" Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center" BorderThickness="0,0,0,1" BorderBrush="Black"/>
+
+        <Button Grid.Row="5" Grid.Column="1"  Content="Set" x:Name="buttonSet" Width="80" Height="26" VerticalAlignment="Top"  Margin="5,3,0,0" Command="{Binding SetCommand}"/>
+        <Button Grid.Row="5" Grid.Column="2" Content="Cancel"  Width="80" Height="26" VerticalAlignment="Top" Margin="44,3,0,0" />
+    </Grid>
+</Window>

+ 28 - 0
Venus/Venus_MainPages/Views/ButterflyValveView.xaml.cs

@@ -0,0 +1,28 @@
+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 Venus_MainPages.Views
+{
+    /// <summary>
+    /// ButterflyValveDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class ButterflyValveView : Window
+    {
+        public ButterflyValveView()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 183 - 0
Venus/Venus_MainPages/Views/EventView.xaml

@@ -0,0 +1,183 @@
+<UserControl x:Class="Venus_MainPages.Views.EventView"
+             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:Venus_MainPages.Views"
+             xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" 
+             xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
+             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800" x:Name="eventView">
+    <i:Interaction.Triggers>
+        <i:EventTrigger EventName="Loaded">
+            <i:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=eventView}"/>
+        </i:EventTrigger>
+    </i:Interaction.Triggers>
+    <Grid HorizontalAlignment="Left">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="260" />
+            <ColumnDefinition Width="*" />
+        </Grid.ColumnDefinitions>
+
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="24"/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto"/>
+            </Grid.RowDefinitions>
+            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
+                <TextBlock Text="Query Condition" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+            </Border>
+            <Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
+                <StackPanel Margin="0,5">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="Start Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
+                        <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
+                            <wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
+                        </wfi:WindowsFormsHost>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
+                        <TextBlock Text="End Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
+                        <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
+                            <wf:DateTimePicker x:Name="wfTimeTo" Value="2013-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
+                        </wfi:WindowsFormsHost>
+                    </StackPanel>
+                </StackPanel>
+            </Border>
+
+            <Border Grid.Row="2" Margin="0,5,0,0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Height="30">
+                <TextBlock Text="Query Option" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+            </Border>
+            <Border Grid.Row="3" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
+                <UniformGrid Columns="2" Margin="0,5">
+                    <CheckBox Content="Alarm" IsChecked="{Binding SearchAlarmEvent}" FontSize="14"/>
+                    <CheckBox Content="Warning" IsChecked="{Binding SearchWarningEvent}" FontSize="14"/>
+                    <CheckBox Content="Information" IsChecked="{Binding SearchInfoEvent}" FontSize="14"/>
+                    <!--<CheckBox Content="Operation" Height="Auto" IsChecked="{Binding SearchOpeLog}" FontSize="14" />-->
+                </UniformGrid>
+            </Border>
+
+            <Border Grid.Row="4" Margin="0,5,0,0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Height="30">
+                <TextBlock Text="Extra Condition" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+            </Border>
+            <Border Grid.Row="5" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
+                <StackPanel Orientation="Horizontal" Margin="0,5">
+                    <TextBlock Text="Key Words" Name="checkBox3" Tag="ReactorC" FontFamily="Arial" FontSize="14" VerticalAlignment="Center"/>
+                    <TextBox Margin="5,0,0,0" FontSize="14" Text="{Binding SearchKeyWords,UpdateSourceTrigger=PropertyChanged}" Width="170"/>
+                </StackPanel>
+            </Border>
+
+            <StackPanel Grid.Row="6" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,20">
+                <Button Width="100" Height="30" FontFamily="Arial" Content="Query" Command="{Binding SearchCommand}">
+                    <!--<i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Click">
+                            <cal:ActionMessage MethodName="Search">
+                            </cal:ActionMessage>
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>-->
+                </Button>
+                <Button Width="100" Height="30" Margin="0,5,0,0" FontFamily="Arial" Content="Export" Command="{Binding ExportCommand}">
+                    <!--<i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Click">
+                            <cal:ActionMessage MethodName="Export">
+                            </cal:ActionMessage>
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>-->
+                </Button>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Column="1" Margin="10,0,0,0">
+            <Grid>
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="Auto"/>
+                    <RowDefinition Height="*"/>
+                </Grid.RowDefinitions>
+                <StackPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal">
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Width="70" Height="24">
+                        <TextBlock  Text="Total:" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
+                    </Border>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Width="130" Height="24">
+                        <TextBlock Text="{Binding SearchedResult.Count}" FlowDirection="LeftToRight" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
+                    </Border>
+                    <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Width="70" Height="24">
+                        <TextBlock Text="Records" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
+                    </Border>-->
+                    <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Width="150" Height="24">
+                        <TextBlock Text="" FlowDirection="LeftToRight" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
+                    </Border>-->
+                </StackPanel>
+
+                <DataGrid Grid.Row="1" Margin="0,5,0,0"
+                          Width="1000"
+                          AlternationCount="2"
+                          ScrollViewer.CanContentScroll="True" 
+                          ScrollViewer.VerticalScrollBarVisibility="Auto"
+                          ScrollViewer.HorizontalScrollBarVisibility="Auto"
+                          HorizontalAlignment="Left"
+                          AutoGenerateColumns="False" Name="dataGrid1" ItemsSource="{Binding SearchedResult,Mode=OneWay}"
+                          FontFamily="Arial,SimSun"
+                          CanUserReorderColumns="False" CanUserAddRows="False"
+                          CanUserSortColumns="False" 
+                          IsReadOnly="True" FontSize="14">
+                    <DataGrid.Columns>
+                        <DataGridTemplateColumn Width="40" CanUserSort="True" SortMemberPath="Icon">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Image Width="20" Height="20" HorizontalAlignment="Center" Stretch="Fill" VerticalAlignment="Center" Source="{Binding Icon}" />
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTextColumn Width="70" Binding="{Binding LogType,Mode=OneWay}"   CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
+
+                            <DataGridTextColumn.HeaderTemplate >
+                                <DataTemplate>
+                                    <TextBlock Text="Type" VerticalAlignment="Center" TextAlignment="Center"/>
+                                </DataTemplate>
+                            </DataGridTextColumn.HeaderTemplate>
+                        </DataGridTextColumn>
+
+                        <DataGridTextColumn Width="200" Binding="{Binding Time,Mode=OneWay}"  CanUserSort="True" CanUserReorder="True" IsReadOnly="True" CanUserResize="False">
+
+                            <DataGridTextColumn.HeaderTemplate >
+                                <DataTemplate>
+                                    <TextBlock Text="Time" VerticalAlignment="Center" TextAlignment="Center"/>
+                                </DataTemplate>
+                            </DataGridTextColumn.HeaderTemplate>
+                        </DataGridTextColumn>
+
+                        <DataGridTextColumn Width="100" Binding="{Binding TargetChamber,Mode=OneWay}"  CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
+
+                            <DataGridTextColumn.HeaderTemplate >
+                                <DataTemplate>
+                                    <TextBlock Text="System" VerticalAlignment="Center" TextAlignment="Center"/>
+                                </DataTemplate>
+                            </DataGridTextColumn.HeaderTemplate>
+                        </DataGridTextColumn>
+
+
+                        <DataGridTextColumn Width="*" Binding="{Binding Detail,Mode=OneWay}"  CanUserSort="True" CanUserReorder="False" IsReadOnly="True"  CanUserResize="False">
+
+                            <DataGridTextColumn.HeaderTemplate >
+                                <DataTemplate>
+                                    <TextBlock Text=" Content" TextWrapping="Wrap" VerticalAlignment="Center" TextAlignment="Center"/>
+                                </DataTemplate>
+                            </DataGridTextColumn.HeaderTemplate>
+                        </DataGridTextColumn>
+                    </DataGrid.Columns>
+                </DataGrid>
+
+            </Grid>
+
+
+
+        </Grid>
+    </Grid>
+</UserControl>

+ 28 - 0
Venus/Venus_MainPages/Views/EventView.xaml.cs

@@ -0,0 +1,28 @@
+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 Venus_MainPages.Views
+{
+    /// <summary>
+    /// EventView.xaml 的交互逻辑
+    /// </summary>
+    public partial class EventView : UserControl
+    {
+        public EventView()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 7
Venus/Venus_MainPages/Views/OverView.xaml

@@ -6,6 +6,7 @@
              xmlns:local="clr-namespace:Venus_MainPages.Views"
              mc:Ignorable="d" 
              xmlns:prism="http://prismlibrary.com/"
+             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:unity="clr-namespace:Venus_MainPages.Unity"
              xmlns:ctrls="clr-namespace:Venus_Themes.UserControls;assembly=Venus_Themes"
@@ -541,9 +542,7 @@
         <!--turbo-->
         <ctrls:Turbo Width="40" Height="40"  Canvas.Top="521" Canvas.Left="1242" IsOpen="{Binding TurboIsOpen}">
             <ctrls:Turbo.ContextMenu>
-                <ContextMenu>
-                    <!--<MenuItem Header="打开" Command="{Binding TurboOpenCommand}"></MenuItem>
-                    <MenuItem Header="关闭" Command="{Binding TurboCloseCommand}"></MenuItem>-->
+                <ContextMenu>                    
                     <RadioButton Content="Open" Command="{Binding OpenTurboPumpCommand}" IsChecked="{Binding TurboIsOpen}"/>
                     <RadioButton Content="Close" Command="{Binding CloseTurboPumpCommand}" IsChecked="{Binding TurboIsOpen,Converter={StaticResource BoolToBool}}"/>
                 </ContextMenu>
@@ -551,9 +550,15 @@
         </ctrls:Turbo>
 
         <!--蝶阀-->
-        <ctrls:ButterflyValve Canvas.Top="475" Canvas.Left="1245" />
-
-        <Image  Canvas.Top="715" Canvas.Left="1425"  Width="40" Height="25"  Source="Pack://application:,,,/Venus_Themes;Component/Resources/Arrow.png" Stretch="Uniform" >
+        <ctrls:ButterflyValve Canvas.Top="475" Canvas.Left="1245" RotateTransformValue="{Binding PositionValue}">
+            <i:Interaction.Triggers>
+                <i:EventTrigger EventName="MouseLeftButtonUp">
+                    <i:InvokeCommandAction Command="{Binding OpenButterflyValveViewCommand}"/>
+                </i:EventTrigger>
+            </i:Interaction.Triggers>
+        </ctrls:ButterflyValve>
+
+        <Image Canvas.Top="715" Canvas.Left="1425"  Width="40" Height="25"  Source="Pack://application:,,,/Venus_Themes;Component/Resources/Arrow.png" Stretch="Uniform">
             <Image.RenderTransform>
                 <RotateTransform Angle="-90"/>
             </Image.RenderTransform>
@@ -589,7 +594,7 @@
         <!--<ctrls:TextboxWithLabel  Canvas.Top="633" Canvas.Left="800" LabelValue="Set(Torr)" TextBoxValue="0.0" TextBoxColor="White" />-->
         <ctrls:TextboxWithLabel  Canvas.Top="633" Canvas.Left="870" LabelValue="Flow(sccm)" TextBoxValue="{Binding RtDataValues[PMA.MfcHe.FeedBack],StringFormat='F1'}" TextBoxColor="#D7E4BD" />
         <ctrls:TextboxWithLabel  Canvas.Top="633" Canvas.Left="1300" LabelValue="CM3(Torr)" TextBoxValue="{Binding RtDataValues[PMA.ForelinePressure],StringFormat='F2'}" TextBoxColor="#D7E4BD" />
-        <ctrls:TextboxWithLabel  Canvas.Top="464" Canvas.Left="1290" LabelValue="Position" TextBoxValue="1000" TextBoxColor="#D7E4BD" />
+        <ctrls:TextboxWithLabel  Canvas.Top="464" Canvas.Left="1290" LabelValue="Position" TextBoxValue="{Binding RtDataValues[PMA.GetPVPosition],StringFormat='F0'}" TextBoxColor="#D7E4BD" />
         <ctrls:TextboxWithLabel  Canvas.Top="511" Canvas.Left="1320" LabelValue="Flow(sccm)" TextBoxValue="{Binding RtDataValues[PMA.MfcN2.FeedBack],StringFormat='F1'}" TextBoxColor="#D7E4BD" />
         <ctrls:TextboxWithLabel  Canvas.Top="581" Canvas.Left="1022" LabelValue="Pressure(Torr)" TextBoxValue="{Binding RtDataValues[PMA.ESCHePressure],StringFormat='F1'}" TextBoxColor="#D7E4BD">
             <ctrls:TextboxWithLabel.RenderTransform>

+ 33 - 5
Venus/Venus_MainPages/Views/TopView.xaml

@@ -9,8 +9,14 @@
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:unity="clr-namespace:Venus_MainPages.Unity"
              xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
+             xmlns:converters="clr-namespace:Venus_Themes.Converters;assembly=Venus_Themes"
+             xmlns:converters2="clr-namespace:Venus_MainPages.Converters"
              mc:Ignorable="d" 
-             d:DesignHeight="100" d:DesignWidth="1800" FontSize="20">
+             d:DesignHeight="100" d:DesignWidth="1800" FontSize="20" x:Name="topView">
+    <UserControl.Resources>
+        <converters:StringToColorConverter x:Key="StringToColorConverter"/>
+        <converters2:EventItemToStringConverter x:Key="EventItemToStringConverter"/>
+    </UserControl.Resources>
     <StackPanel Background="{DynamicResource BottomFrame_BG}" Orientation="Horizontal">
         <TextBlock Style="{StaticResource textBlockStyle}" Text="{Binding Title}" FontSize="60"   VerticalAlignment="Center" Margin="10,0,0,0" />
 
@@ -34,10 +40,32 @@
             <TextBlock Text="PMA" Foreground="White"   HorizontalAlignment="Center" VerticalAlignment="Center"/>
             <TextBlock Text="{Binding RtDataValues[PMA.FsmState]}" Background="Yellow" Grid.Column="1" Grid.ColumnSpan="3"  Margin="2" Padding="0,8,0,0" Block.TextAlignment="Center" FontSize="20"/>
             <TextBlock Text="Log" Grid.Row="1" Foreground="White"  TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-            <ComboBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="5" 
-                                       
-                                      VerticalContentAlignment="Center" FontSize="14" Height="Auto">
-              
+            <ComboBox Grid.Column="1"  Grid.Row="1" Grid.ColumnSpan="5" 
+                                       ItemsSource="{Binding EventLogList}"   
+                                       SelectedIndex="{Binding EventLogListSelectedIndex}"                                
+                                       VerticalContentAlignment="Center" FontSize="20" >
+                <ComboBox.ItemTemplate>
+                    <DataTemplate>
+                        <StackPanel Orientation="Horizontal">
+                            <TextBlock Text="{Binding ElementName=topView,Path=DataContext.CurrentEventItem,Converter={StaticResource EventItemToStringConverter}}" Foreground="{Binding ElementName=topView,Path=DataContext.CurrentEventItem.Level,Converter={StaticResource StringToColorConverter}}"/>
+                        </StackPanel>
+                    </DataTemplate>
+                </ComboBox.ItemTemplate>
+                <ComboBox.ItemContainerStyle>
+                    <Style TargetType="ComboBoxItem">
+                        <Setter Property="Template">
+                            <Setter.Value>
+                                <ControlTemplate TargetType="ComboBoxItem">
+                                    <StackPanel Orientation="Horizontal">
+                                        <TextBlock Text="{Binding .,Converter={StaticResource EventItemToStringConverter}}" 
+                                                   Foreground="{Binding Level,Converter={StaticResource StringToColorConverter}}"/>
+                                    </StackPanel>
+                                </ControlTemplate>
+                            </Setter.Value>
+                        </Setter>
+                        <Setter Property="Background"  Value="{Binding Level,Converter={StaticResource StringToColorConverter}}"/>
+                    </Style>
+                </ComboBox.ItemContainerStyle>
             </ComboBox>
             <StackPanel Orientation="Horizontal" Grid.Column="4" Grid.ColumnSpan="2" HorizontalAlignment="Center">
                 <TextBlock Text="版本号:"  Foreground="White" FontSize="20" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>

+ 11 - 0
Venus/Venus_RT/Devices/JetPM.cs

@@ -410,6 +410,8 @@ namespace Venus_RT.Devices
             DATA.Subscribe($"{Name}.SRfIsOn", () => _Generator.IsPowerOn);
             DATA.Subscribe($"{Name}.BRfIsOn", () => _GeneratorBias.IsPowerOn);
             DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => _TurboPump.RotationalSpeed);
+
+            DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
             
             //DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => _);
 
@@ -445,6 +447,15 @@ namespace Venus_RT.Devices
                 return true;
             });
 
+            OP.Subscribe($"{Module}.SetPVPostion", (cmd, args) => {
+                SetPVPostion((int)args[0]);
+                return true;
+            });
+            OP.Subscribe($"{Module}.SetPVPressure", (cmd, args) => {
+                SetPVPressure((int)args[0]);
+                return true;
+            });
+
 
             _foreline_interlock_pressure = SC.GetValue<double>($"{mod}.ForelineInterlockPressure");
         }

+ 12 - 0
Venus/Venus_RT/Instances/ToolLoader.cs

@@ -24,6 +24,8 @@ using Venus_RT.Backends;
 using Venus_RT.HostWrapper;
 using Venus_RT.Modules.PMs;
 using MECF.Framework.Common.DataCenter;
+using MECF.Framework.Common.OperationCenter;
+using Aitex.Core.Account;
 
 namespace Venus_RT.Instances
 {
@@ -87,6 +89,16 @@ namespace Venus_RT.Instances
             Singleton<EventManager>.Instance.FireEvent += InstanceOnOnEvent;
 
             string s1 = System.Diagnostics.FileVersionInfo.GetVersionInfo(Path.Combine(PathManager.GetAppDir(), "Venus_RT.exe")).ProductVersion;
+
+
+            //System.Threading.Tasks.Task.Run(() =>
+            //{
+            //    System.Threading.Thread.Sleep(10000);
+            //    EV.PostWarningLog("System", $"{111} stats wafer value larger than wafer setting alarm value");
+            //    EV.PostAlarmLog("System", $"{222} stats wafer value larger than wafer setting alarm value");
+            //});
+            
+
         }
         private void InstanceOnOnEvent(EventItem obj)
         {

+ 1 - 0
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -403,6 +403,7 @@ namespace Venus_RT.Modules.PMs
 
         private bool FnStartHome(object[] objs)
         {
+
             return _home.Start() == RState.Running;
         }
 

+ 24 - 0
Venus/Venus_Themes/Converters/BoolToUnitConverter.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Venus_Themes.Converters
+{
+    public class BoolToUnitConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+
+            return (bool)value ? "%" : "mTorr";
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return null;
+
+        }
+    }
+}

+ 39 - 0
Venus/Venus_Themes/Converters/StringToColorConverter.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace Venus_Themes.Converters
+{
+    public class StringToColorConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            switch (value.ToString())
+            {
+                case "Information":
+                    return new SolidColorBrush(Colors.Green);
+
+                case "Warning":
+                    return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ffd400"));
+
+                case "Alarm":
+                    return new SolidColorBrush(Colors.Red);
+
+                 default:
+                    return new SolidColorBrush(Colors.Silver);
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (!(value is bool))
+                return false;
+
+            return !(bool)value;
+        }
+    }
+}

+ 26 - 32
Venus/Venus_Themes/UserControls/ButterflyValveMessageBox.xaml

@@ -5,12 +5,13 @@
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:Venus_Themes.UserControls"
              xmlns:converters="clr-namespace:Venus_Themes.Converters"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
+             mc:Ignorable="d" Width="300" Height="400" x:Name="butterflyValveMessageBox"
+             >
     <Grid>
         <Grid.Resources>
             <Style TargetType="RadioButton"/>
             <converters:BoolToValueConverter x:Key="BoolToValueConverter"/>
+            <converters:BoolToBool x:Key="BoolToBool"/>
         </Grid.Resources>
         <Grid.RowDefinitions>
             <RowDefinition/>
@@ -27,43 +28,36 @@
             <ColumnDefinition Width="auto"/>
             <ColumnDefinition Width="1*"/>
         </Grid.ColumnDefinitions>
-        <Label Grid.Row="0" Grid.Column="1" Content="Device Name:" />
-        <Label Grid.Row="1" Grid.Column="1" Content="Work Mode:" />
-        <Label Grid.Row="2" Grid.Column="1" Content="Max:" />
-        <Label Grid.Row="3" Grid.Column="1" Content="Unit:" />
-        <Label Grid.Row="4" Grid.Column="1" Content="Feedback:" />
-        <Label Grid.Row="5" Grid.Column="1" Content="Set Point:" />
+        <TextBlock Grid.Row="0" Grid.Column="1" Text="Device Name:"  VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,20,0,0"/>
+        <TextBlock Grid.Row="1" Grid.Column="1" Text="Work Mode:" VerticalAlignment="Center" Block.TextAlignment="Right" />
+        <TextBlock Grid.Row="2" Grid.Column="1" Text="Max:" VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,20,0,0"/>
+        <TextBlock Grid.Row="3" Grid.Column="1" Text="Unit:" VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,20,0,0"/>
+        <TextBlock Grid.Row="4" Grid.Column="1" Text="Feedback:" VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,20,0,0"/>
+        <TextBlock Grid.Row="5" Grid.Column="1" Text="Set Point:" VerticalAlignment="Center" Block.TextAlignment="Right" Margin="0,20,0,0"/>
 
-        <Label Grid.Row="0" Grid.Column="2" Content="{Binding Path=DeviceName}" Width="150" Height="28" HorizontalAlignment="Left" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" VerticalContentAlignment="Center" />
-        <Label Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Left" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="10" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" >
-            <StackPanel Orientation="Horizontal">
-                <CheckBox x:Name="ckPosition"    VerticalContentAlignment="Center">Position</CheckBox>
-                <CheckBox x:Name="ckPressure"     Margin="10,0,0,0" VerticalContentAlignment="Center">Pressure</CheckBox>
-            </StackPanel>
+        <Label  Grid.Row="0" Grid.Column="2" Content="{Binding Path=DeviceName}" Width="150" Height="28" HorizontalAlignment="Left"  FontSize="13" FontFamily="Arial,SimSun"  BorderThickness="0,0,0,1" BorderBrush="Black"/>
+        <!--<Label Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Left" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="10" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" >
+            
 
-        </Label>
+        </Label>-->
+        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="2">
+            <RadioButton x:Name="ckPosition" IsChecked="{Binding ElementName=butterflyValveMessageBox,Path=IsPositionMode}"   VerticalContentAlignment="Center">Position</RadioButton>
+            <RadioButton x:Name="ckPressure" IsChecked="{Binding ElementName=butterflyValveMessageBox,Path=IsPositionMode,Converter={StaticResource BoolToBool}}"   Margin="10,0,0,0" VerticalContentAlignment="Center">Pressure</RadioButton>
+        </StackPanel>
 
-        <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=MaxValuePosition}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" 
-              />
-        <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=MaxValuePressure}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" 
-                             />
+        <!--<TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding Path=MaxValuePosition}" Width="150"  FontSize="13" FontFamily="Arial,SimSun" Height="28" />-->
+        <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=MaxValuePressure}" Width="150"  FontSize="13" FontFamily="Arial,SimSun" Height="28" BorderThickness="0,0,0,1" BorderBrush="Black"/>
 
-        <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=UnitPosition}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
-               />
-        <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=UnitPressure}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" 
-              />
+        <!--<TextBlock Grid.Row="3" Grid.Column="2" Text="{Binding Path=UnitPosition}" Width="150"       FontSize="13" FontFamily="Arial,SimSun" Height="28" />-->
+        <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=UnitPressure}" Width="150"       FontSize="13" FontFamily="Arial,SimSun" Height="28" BorderThickness="0,0,0,1" BorderBrush="Black"/>
 
-        <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=FeedbackPosition}" ContentStringFormat="F1"  Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
-              />
-        <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=FeedbackPressure}"  ContentStringFormat="F1" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
-               />
+        <!--<TextBlock Grid.Row="4" Grid.Column="2" Text="{Binding Path=FeedbackPosition}"  FontFamily="Arial,SimSun" Height="28"/>-->
+        <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=FeedbackPressure}"   Width="150"  FontSize="13" FontFamily="Arial,SimSun" Height="28" BorderThickness="0,0,0,1" BorderBrush="Black"/>
 
-        <TextBox Grid.Row="5" Grid.Column="2" x:Name="inputBoxPosition" BorderBrush="Green" BorderThickness="0,0,0,1"  Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center"
-                />
-        <TextBox Grid.Row="5" Grid.Column="2" x:Name="inputBoxPressure" BorderBrush="Green" BorderThickness="0,0,0,1"   Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center" 
-                 />
+        <!--<TextBox Grid.Row="5" Grid.Column="2" x:Name="inputBoxPosition" BorderBrush="Green" BorderThickness="0,0,0,1"  Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center"/>-->
+        <TextBox Grid.Row="5" Grid.Column="2" x:Name="inputBoxPressure"    Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center" BorderThickness="0,0,0,1" BorderBrush="Black"/>
 
-        <Button Grid.Row="6" Grid.ColumnSpan="2"  Content="Set" x:Name="buttonSet" Width="80" Height="26" VerticalAlignment="Top" Grid.Column="1" Margin="5,3,0,0" />
+        <Button Grid.Row="6" Grid.Column="1"  Content="Set" x:Name="buttonSet" Width="80" Height="26" VerticalAlignment="Top"  Margin="5,3,0,0" />
         <Button Grid.Row="6" Grid.Column="2" Content="Cancel"  Width="80" Height="26" VerticalAlignment="Top" Margin="44,3,0,0" />
     </Grid>
 </Window>

+ 14 - 0
Venus/Venus_Themes/UserControls/ButterflyValveMessageBox.xaml.cs

@@ -24,5 +24,19 @@ namespace Venus_Themes.UserControls
         {
             InitializeComponent();
         }
+        public static readonly DependencyProperty IsPositionModeProperty = DependencyProperty.Register(
+          "IsPositionMode", typeof(bool), typeof(ButterflyValveMessageBox));
+
+        public bool IsPositionMode
+        {
+            get
+            {
+                return (bool)this.GetValue(IsPositionModeProperty);
+            }
+            set
+            {
+                this.SetValue(IsPositionModeProperty, value);
+            }
+        }
     }
 }

+ 2 - 0
Venus/Venus_Themes/Venus_Themes.csproj

@@ -65,6 +65,7 @@
     <Compile Include="Converters\BoolToInt.cs" />
     <Compile Include="Converters\BoolToPath.cs" />
     <Compile Include="Converters\BoolToReverse.cs" />
+    <Compile Include="Converters\BoolToUnitConverter.cs" />
     <Compile Include="Converters\BoolToValueConverter.cs" />
     <Compile Include="Converters\BoolToVisibility.cs" />
     <Compile Include="Converters\boolToVisibility2.cs" />
@@ -76,6 +77,7 @@
     <Compile Include="Converters\IntToIsEnableConverter.cs" />
     <Compile Include="Converters\Null2Bool.cs" />
     <Compile Include="Converters\String2Double.cs" />
+    <Compile Include="Converters\StringToColorConverter.cs" />
     <Compile Include="Converters\ToBoolMultiValueConverter.cs" />
     <Compile Include="Converters\ToBoolMultiValueConverter2.cs" />
     <Compile Include="Converters\ToBoolMultiValueConverter3.cs" />

+ 6 - 0
Venus/Venus_UI/Config/VenusMenu.json

@@ -95,10 +95,16 @@
     "Id": "DataLog",
     "MenuItem": [
       {
+        "Id": "Event",
+        "Name": "Event",
+        "View": "EventView"
+      },
+      {
         "Id": "Statistics",
         "Name": "Partial Pressure",
         "View": ""
       }
+
     ]
   }
 ]