终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

MainViewModel.cs 29 KiB

2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900
  1. using BeDesignerSCADA.Common;
  2. using BeDesignerSCADA.Controls;
  3. using BeDesignerSCADA.View;
  4. using BPASmartClient.Compiler;
  5. using BPASmartClient.DATABUS;
  6. using BPASmartClient.MessageName;
  7. using BPASmartClient.MessageName.EnumHelp;
  8. using BPASmartClient.MessageName.发送消息Model;
  9. using BPASmartClient.MessageName.接收消息Model;
  10. using ICSharpCode.AvalonEdit;
  11. using Microsoft.Toolkit.Mvvm.ComponentModel;
  12. using Microsoft.Toolkit.Mvvm.Input;
  13. using Microsoft.Win32;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Collections.ObjectModel;
  17. using System.ComponentModel;
  18. using System.Linq;
  19. using System.Reflection;
  20. using System.Text;
  21. using System.Threading.Tasks;
  22. using System.Windows;
  23. using System.Windows.Input;
  24. using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
  25. namespace BeDesignerSCADA.ViewModel
  26. {
  27. /// <summary>
  28. /// 主函数 ViewModel
  29. /// </summary>
  30. public class MainViewModel :ObservableObject
  31. {
  32. public MainViewModel()
  33. {
  34. IsRunning = false;
  35. //启动 或者 停止
  36. RunUiCommand = new RelayCommand(() =>
  37. {
  38. IsRunning = !IsRunning;
  39. });
  40. }
  41. #region 变量
  42. /// <summary>
  43. /// 是否正在运行状态
  44. /// </summary>
  45. private bool _IsRunning = false;
  46. public bool IsRunning
  47. {
  48. get
  49. {
  50. return _IsRunning;
  51. }
  52. set
  53. {
  54. _IsRunning = value;
  55. if (value)
  56. {
  57. RunCanvasVisibility = Visibility.Visible;
  58. CanvasPanelVisibility = Visibility.Hidden;
  59. }
  60. else
  61. {
  62. RunCanvasVisibility = Visibility.Hidden;
  63. CanvasPanelVisibility = Visibility.Visible;
  64. }
  65. OnPropertyChanged("IsRunning");
  66. }
  67. }
  68. /// <summary>
  69. /// 画布是否显示
  70. /// </summary>
  71. private Visibility _CanvasPanelVisibility;
  72. public Visibility CanvasPanelVisibility
  73. {
  74. get
  75. {
  76. return _CanvasPanelVisibility;
  77. }
  78. set
  79. {
  80. if (_CanvasPanelVisibility == value)
  81. return;
  82. _CanvasPanelVisibility = value;
  83. OnPropertyChanged("CanvasPanelVisibility");
  84. }
  85. }
  86. /// <summary>
  87. /// 运行代码是否显示
  88. /// </summary>
  89. private Visibility _RunCanvasVisibility;
  90. public Visibility RunCanvasVisibility
  91. {
  92. get
  93. {
  94. return _RunCanvasVisibility;
  95. }
  96. set
  97. {
  98. if (_RunCanvasVisibility == value)
  99. return;
  100. _RunCanvasVisibility = value;
  101. OnPropertyChanged("RunCanvasVisibility");
  102. }
  103. }
  104. /// <summary>
  105. /// 当前代码Xaml
  106. /// </summary>
  107. private string _XamlCode;
  108. public string XamlCode
  109. {
  110. get
  111. {
  112. return _XamlCode;
  113. }
  114. set
  115. {
  116. if (_XamlCode == value)
  117. return;
  118. _XamlCode = value;
  119. OnPropertyChanged("XamlCode");
  120. }
  121. }
  122. /// <summary>
  123. /// 选中控件
  124. /// </summary>
  125. private FrameworkElement _CanSelectedItem;
  126. public FrameworkElement CanSelectedItem
  127. {
  128. get
  129. {
  130. return _CanSelectedItem;
  131. }
  132. set
  133. {
  134. if (_CanSelectedItem == value)
  135. return;
  136. _CanSelectedItem = value;
  137. SelectedPropertyDataRefresh();
  138. OnPropertyChanged("CanSelectedItem");
  139. }
  140. }
  141. /// <summary>
  142. /// 控制协议属性
  143. /// </summary>
  144. private PropertyGridCommand _pro;
  145. public PropertyGridCommand PropeObject
  146. {
  147. get
  148. {
  149. return _pro;
  150. }
  151. set
  152. {
  153. _pro = value;
  154. OnPropertyChanged("PropeObject");
  155. }
  156. }
  157. /// <summary>
  158. /// 设备名称集合
  159. /// </summary>
  160. private ObservableCollection<string> _DevNameList;
  161. public ObservableCollection<string> DevNameList
  162. {
  163. get
  164. {
  165. return _DevNameList;
  166. }
  167. set
  168. {
  169. _DevNameList = value;
  170. OnPropertyChanged("DevNameList");
  171. }
  172. }
  173. /// <summary>
  174. /// 设备变量集合
  175. /// </summary>
  176. private ObservableCollection<string> _DevValueList;
  177. public ObservableCollection<string> DevValueList
  178. {
  179. get
  180. {
  181. return _DevValueList;
  182. }
  183. set
  184. {
  185. _DevValueList = value;
  186. OnPropertyChanged("DevValueList");
  187. }
  188. }
  189. #endregion
  190. #region 命令
  191. /// <summary>
  192. /// 启动或者停止
  193. /// </summary>
  194. public RelayCommand RunUiCommand { get; set; }
  195. /// <summary>
  196. /// 编辑
  197. /// </summary>
  198. public RelayCommand EditCommand { get; set; }
  199. #endregion
  200. #region 常用函数
  201. /// <summary>
  202. /// 显示当前xaml代码
  203. /// </summary>
  204. public void ShowCode(TextEditor textEditor)
  205. {
  206. textEditor.Text = canvasPanel.Save();
  207. }
  208. #endregion
  209. #region 脚本编辑数据
  210. /// <summary>
  211. /// 当前编辑界面
  212. /// </summary>
  213. public CanvasPanel canvasPanel;
  214. /// <summary>
  215. /// 当前运行界面
  216. /// </summary>
  217. public RunCanvas runCanvas;
  218. /// <summary>
  219. /// 加载
  220. /// </summary>
  221. /// <param name="obj"></param>
  222. public void Loaded(object objCan,object objRun)
  223. {
  224. canvasPanel = objCan as CanvasPanel;
  225. runCanvas = objRun as RunCanvas;
  226. }
  227. /// <summary>
  228. /// 编辑
  229. /// </summary>
  230. /// <param name="obj"></param>
  231. public void Edit(object obj)
  232. {
  233. string result = JsEditWindow.ShowEdit(((Xceed.Wpf.Toolkit.PropertyGrid.PropertyItem)obj).Value?.ToString(),canvasPanel.GetAllExecChildren());
  234. ((Xceed.Wpf.Toolkit.PropertyGrid.PropertyItem)obj).Value = result;
  235. }
  236. #endregion
  237. #region 图片选择路径
  238. public void SelectPath(object obj)
  239. {
  240. OpenFileDialog ofd = new OpenFileDialog();
  241. ofd.Filter = "图片|*.jpg;*.png;*.gif;*.jpeg;*.bmp";
  242. if (ofd.ShowDialog() == true)
  243. {
  244. //((DevExpress.Xpf.Editors.EditableDataObject)obj).Value = ofd.FileName;
  245. }
  246. }
  247. #endregion
  248. #region 属性填充
  249. /// <summary>
  250. /// 选中属性数据刷新
  251. /// </summary>
  252. public void SelectedPropertyDataRefresh()
  253. {
  254. //属性变量
  255. PropertyGridCommand cmd = new PropertyGridCommand();
  256. var content = CanSelectedItem;
  257. if (content is IExecutable executable)
  258. executable.PropertyChange += Executable_PropertyChange;
  259. foreach (var item in EventName)
  260. {
  261. System.Reflection.PropertyInfo info = content.GetType().GetProperty(item.Key);
  262. var propName = info?.GetValue(content,null);
  263. if (info != null && (item.Key == "Content" ? (propName is string) : true))
  264. {
  265. SetPropertyVisibility(cmd,item.Value,true);
  266. cmd.GetType().GetProperty(item.Value).SetValue(cmd,propName);
  267. }
  268. else
  269. {
  270. SetPropertyVisibility(cmd,item.Value,false);
  271. }
  272. }
  273. cmd.PropertyChanged += Cmd_PropertyChanged;
  274. PropeObject = null;
  275. PropeObject = cmd;
  276. }
  277. /// <summary>
  278. /// 内部属性变化通知
  279. /// </summary>
  280. /// <param name="sender"></param>
  281. /// <param name="e"></param>
  282. private void Executable_PropertyChange(object? sender,EventArgs e)
  283. {
  284. //System.Windows.Controls.Control content = CanSelectedItem as System.Windows.Controls.Control;
  285. //System.Reflection.PropertyInfo info = content.GetType().GetProperty("GenerateData");
  286. //var propName = info?.GetValue(content,null);
  287. //PropeObject.GetType().GetProperty("数据结果").SetValue(PropeObject,propName);
  288. //DevNameList = new System.Collections.ObjectModel.ObservableCollection<string>();
  289. //DevValueList = new System.Collections.ObjectModel.ObservableCollection<string>();
  290. //Class_DataBus.GetInstance().Dic_DeviceData.Keys?.ToList().ForEach(key => { DevNameList.Add(key); });
  291. }
  292. /// <summary>
  293. /// 修改属性后
  294. /// </summary>
  295. /// <param name="sender"></param>
  296. /// <param name="e"></param>
  297. private void Cmd_PropertyChanged(object? sender,PropertyChangedEventArgs e)
  298. {
  299. try
  300. {
  301. string name = e.PropertyName;
  302. foreach (var item in EventName)
  303. {
  304. if (item.Value == name)
  305. {
  306. name = item.Key;
  307. }
  308. }
  309. PropertyGridCommand hotinfo = (PropertyGridCommand)sender;
  310. System.Reflection.PropertyInfo info = hotinfo.GetType().GetProperty(e.PropertyName);
  311. var propName = info?.GetValue(hotinfo,null);
  312. ProGridSetValue(name,propName);
  313. }
  314. catch (Exception ex)
  315. {
  316. }
  317. }
  318. /// <summary>
  319. /// 设置变量
  320. /// </summary>
  321. /// <param name="value"></param>
  322. public void ProGridSetValue(string Name,object value)
  323. {
  324. try
  325. {
  326. var content = CanSelectedItem;
  327. if (Name == "Content" ? (content is BPASmartClient.SCADAControl.CustomerControls.TheButton) : true)
  328. {
  329. System.Reflection.PropertyInfo info = content.GetType().GetProperty(Name);
  330. if (info != null)
  331. {
  332. if (info.ToString().Contains("Double"))
  333. {
  334. info?.SetValue(content, Double.Parse(value.ToString()), null);
  335. }
  336. else if (info.ToString().Contains("String"))
  337. {
  338. info?.SetValue(content, value, null);
  339. }
  340. else if (info.ToString().Contains("Int"))
  341. {
  342. info?.SetValue(content, int.Parse(value.ToString()), null);
  343. }
  344. else
  345. {
  346. info?.SetValue(content, value, null);
  347. }
  348. }
  349. }
  350. }
  351. catch (Exception ex)
  352. {
  353. }
  354. }
  355. #endregion
  356. #region 特性控制
  357. /// <summary>
  358. /// 通过反射控制属性是否可见
  359. /// </summary>
  360. /// <param name="obj"></param>
  361. /// <param name="propertyName"></param>
  362. /// <param name="visible"></param>
  363. public static void SetPropertyVisibility(object obj,string propertyName,bool visible)
  364. {
  365. Type type = typeof(BrowsableAttribute);
  366. PropertyDescriptorCollection props = TypeDescriptor.GetProperties(obj);
  367. AttributeCollection attrs = props[propertyName].Attributes;
  368. FieldInfo fld = CallPrivatevariables(type,"<Browsable>k__BackingField");
  369. // FieldInfo fld = type.GetField("Browsable",BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreReturn | BindingFlags.GetProperty);
  370. fld.SetValue(attrs[type],visible);
  371. }
  372. /// <summary>
  373. /// 获取指定对象的指定成员变量
  374. /// </summary>
  375. /// <typeparam name="T"></typeparam>
  376. /// <param name="obj"></param>
  377. /// <param name="name"></param>
  378. /// <returns></returns>
  379. public static FieldInfo CallPrivatevariables(Type type,string name)
  380. {
  381. //BindingFlags flag = System.Reflection.BindingFlags.IgnoreCase | System.Reflection.BindingFlags.NonPublic;
  382. //Type type = obj.GetType();
  383. //var fieldInfos_ = type.GetField(name, flag);
  384. var fieldInfos = (System.Reflection.FieldInfo[])((System.Reflection.TypeInfo)type).DeclaredFields;
  385. FieldInfo fieldInfo_ = null;
  386. foreach (FieldInfo fieldInfo in fieldInfos)
  387. {
  388. if (fieldInfo.Name == name)
  389. {
  390. return fieldInfo;// (T)fieldInfo.GetValue(obj);
  391. }
  392. }
  393. //FieldInfo fieldInfo = type.GetField(name, flag);
  394. return fieldInfo_;// (T)fieldInfo_.GetValue(obj);
  395. }
  396. /// <summary>
  397. /// 设置Category特性的值
  398. /// </summary>
  399. /// <param name="obj"></param>
  400. /// <param name="propertyName"></param>
  401. /// <param name="str"></param>
  402. public void SetCategoryValue(object obj,string propertyName,string str)
  403. {
  404. Type type = typeof(CategoryAttribute);
  405. PropertyDescriptorCollection props = TypeDescriptor.GetProperties(obj);
  406. AttributeCollection attrs = props[propertyName].Attributes;
  407. FieldInfo fld = type.GetField("categoryValue",BindingFlags.Instance | BindingFlags.NonPublic);
  408. fld?.SetValue(attrs[type],str);
  409. }
  410. /// <summary>
  411. /// 获取类的属性成员的Category特性的值
  412. /// </summary>
  413. /// <param name="obj"></param>
  414. /// <param name="propertyName"></param>
  415. /// <returns></returns>
  416. public string GetCategoryValue(object obj,string propertyName)
  417. {
  418. Type type = typeof(CategoryAttribute);
  419. PropertyDescriptorCollection props = TypeDescriptor.GetProperties(obj);
  420. AttributeCollection attrs = props[propertyName].Attributes;
  421. FieldInfo fld = type.GetField("categoryValue",BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
  422. var str = fld?.GetValue(attrs[type])?.ToString();
  423. return str;
  424. }
  425. /// <summary>
  426. /// 设置类的CategoryOrderAttribute特性的值
  427. /// </summary>
  428. /// <param name="obj"></param>
  429. /// <param name="categoryOrders"></param>
  430. public void SetCategoryOrderValue(object obj,CategoryOrderAttribute[] categoryOrders)
  431. {
  432. TypeDescriptor.AddAttributes(obj.GetType(),categoryOrders);
  433. }
  434. /// <summary>
  435. /// 使用反射设置嵌套属性的值
  436. /// </summary>
  437. /// <param name="obj">对象 </param>
  438. /// <param name="propename">第一层属性</param>
  439. /// <param name="targetname">目标属性(是第一层属性的成员)</param>
  440. /// <param name="val">赋的值</param>
  441. private void NestPropeSetValue(object obj,string propename,string targetname,object val)
  442. {
  443. PropertyInfo[] propertyInfos = obj.GetType().GetProperties();
  444. var prope = propertyInfos.Single(x => propename == x.PropertyType.Name);
  445. var value = prope.GetValue(obj,null);
  446. var pr = value.GetType().GetProperties().Single(x => x.Name == targetname);
  447. pr?.SetValue(value,val);
  448. }
  449. #endregion
  450. Dictionary<string, string> EventName = new Dictionary<string, string> {
  451. {"Name","名称" },
  452. {"Text","文本" },
  453. {"Content","按钮文本" },
  454. {"Title","标题" },
  455. {"Value","变量" },
  456. {"BindingIsChecked","勾选状态" },
  457. {"ClickExec","点击事件" },
  458. {"ValueChangedExecute" , "值改变事件"},
  459. {"TikcExecute" , "定时触发"},
  460. {"CheckedExec" , "勾选事件"},
  461. {"UnCheckedExec" , "取消勾选事件"},
  462. {"EventReceiveNameList" , "接收消息集"},
  463. { "TimeCount" , "定时间隔"},
  464. { "InterfaceMode" , "接口类型"},
  465. { "InterfaceParameters" , "接口参数"},
  466. { "DataSouceInformation" , "连接信息"},
  467. { "DeviceName" , "设备名称"},
  468. { "DeviceValuleName" , "设备解析变量"},
  469. {"FDataSouce" , "数据源"},
  470. { "Code" , "代码过滤脚本"},
  471. { "GenerateData" , "数据结果"},
  472. };
  473. }
  474. [CategoryOrder("基本属性",1), CategoryOrder("事件",2)]//分组在排序
  475. public class PropertyGridCommand :ObservableObject
  476. {
  477. private string _名称;
  478. private string _文本;
  479. private string _标题;
  480. private string _文本1;
  481. private object _变量;
  482. private string _勾选状态;
  483. [Category("基本属性"), Description("Name"), Browsable(false), PropertyOrder(1)]
  484. public string 名称
  485. {
  486. get
  487. {
  488. return _名称;
  489. }
  490. set
  491. {
  492. if (_名称 == value)
  493. return;
  494. _名称 = value;
  495. OnPropertyChanged("名称");
  496. }
  497. }
  498. [Category("基本属性"), Description("Text"), Browsable(true), PropertyOrder(3)]
  499. public string 文本
  500. {
  501. get
  502. {
  503. return _文本;
  504. }
  505. set
  506. {
  507. if (_文本 == value)
  508. return;
  509. _文本 = value;
  510. OnPropertyChanged("文本");
  511. }
  512. }
  513. [Category("基本属性"), Description("Title"), Browsable(true), PropertyOrder(2)]
  514. public string 标题
  515. {
  516. get
  517. {
  518. return _标题;
  519. }
  520. set
  521. {
  522. if (_标题 == value)
  523. return;
  524. _标题 = value;
  525. OnPropertyChanged("标题");
  526. }
  527. }
  528. [Category("基本属性"), Description("Content"), Browsable(true), PropertyOrder(3)]
  529. public string 按钮文本
  530. {
  531. get
  532. {
  533. return _文本1;
  534. }
  535. set
  536. {
  537. if (_文本1 == value)
  538. return;
  539. _文本1 = value;
  540. OnPropertyChanged("按钮文本");
  541. }
  542. }
  543. [Category("基本属性"), Description("Value"), Browsable(true), PropertyOrder(4)]
  544. public object 变量
  545. {
  546. get
  547. {
  548. return _变量;
  549. }
  550. set
  551. {
  552. if (_变量 == value)
  553. return;
  554. _变量 = value;
  555. OnPropertyChanged("变量");
  556. }
  557. }
  558. [Category("基本属性"), Description("BindingIsChecked"), Browsable(false), PropertyOrder(5)]
  559. public string 勾选状态
  560. {
  561. get
  562. {
  563. return _勾选状态;
  564. }
  565. set
  566. {
  567. if (_勾选状态 == value)
  568. return;
  569. _勾选状态 = value;
  570. OnPropertyChanged("勾选状态");
  571. }
  572. }
  573. //[Category("基本属性"), Description("Content"), Browsable(true), PropertyOrder(2)]
  574. //public string 内容 { get; set; }
  575. //[Category("基本属性"), Description("Header"), Browsable(true), PropertyOrder(3)]
  576. //public string 标题 { get; set; }
  577. //[Category("基本属性"), Description("Text"), Browsable(true), PropertyOrder(4)]
  578. //public object 文本 { get; set; }
  579. //[Category("基本属性"), Description("NumberValue"), Browsable(true), PropertyOrder(5)]
  580. //public object 值 { get; set; }
  581. //[Category("基本属性"), Description("CurValue"), Browsable(true), PropertyOrder(5)]
  582. //public object 数值 { get; set; }
  583. //[Category("基本属性"), Description("StatusValue"), Browsable(true), PropertyOrder(6)]
  584. //public string 状态值 { get; set; }
  585. //[Category("基本属性"), Description("IsChecked"), Browsable(true), PropertyOrder(7)]
  586. //public string 勾选状态 { get; set; }
  587. //[Category("基本属性"), Description("Value"), Browsable(true), PropertyOrder(7)]
  588. //public string 数值1 { get; set; }
  589. //[Category("基本属性"), Description("MaxValue"), Browsable(true), PropertyOrder(8)]
  590. //public string 最大值 { get; set; }
  591. //[Category("基本属性"), Description("MinValue"), Browsable(true), PropertyOrder(9)]
  592. //public object 最小值 { get; set; }
  593. //[Category("基本属性"), Description("Maximum"), Browsable(true), PropertyOrder(8)]
  594. //public string 最大值1 { get; set; }
  595. //[Category("基本属性"), Description("Minimum"), Browsable(true), PropertyOrder(9)]
  596. //public object 最小值1 { get; set; }
  597. //[Category("基本属性"), Description("Interval"), Browsable(true), PropertyOrder(10)]
  598. //public object 间隔 { get; set; }
  599. //[Category("基本属性"), Description("左边距"), Browsable(true), PropertyOrder(11)]
  600. //public string 左边距 { get; set; }
  601. //[Category("基本属性"), Description("上边距"), Browsable(true), PropertyOrder(12)]
  602. //public string 上边距 { get; set; }
  603. //事件处理中心
  604. private string _点击事件;
  605. private string _值改变事件;
  606. private string _定时触发;
  607. private string _勾选事件;
  608. private string _取消勾选事件;
  609. private ObservableCollection<EventReceiveMessage> _接收消息集;
  610. [Category("事件-内部触发"), Description("ClickExec"), Browsable(true), PropertyOrder(1)]
  611. public string 点击事件
  612. {
  613. get
  614. {
  615. return _点击事件;
  616. }
  617. set
  618. {
  619. if (_点击事件 == value)
  620. return;
  621. _点击事件 = value;
  622. OnPropertyChanged("点击事件");
  623. }
  624. }
  625. [Category("事件-内部触发"), Description("ValueChangedExecute"), Browsable(true), PropertyOrder(2)]
  626. public string 值改变事件
  627. {
  628. get
  629. {
  630. return _值改变事件;
  631. }
  632. set
  633. {
  634. if (_值改变事件 == value)
  635. return;
  636. _值改变事件 = value;
  637. OnPropertyChanged("值改变事件");
  638. }
  639. }
  640. [Category("事件-内部触发"), Description("TikcExecute"), Browsable(true), PropertyOrder(3)]
  641. public string 定时触发
  642. {
  643. get
  644. {
  645. return _定时触发;
  646. }
  647. set
  648. {
  649. if (_定时触发 == value)
  650. return;
  651. _定时触发 = value;
  652. OnPropertyChanged("定时触发");
  653. }
  654. }
  655. [Category("事件-内部触发"), Description("CheckedExec"), Browsable(true), PropertyOrder(4)]
  656. public string 勾选事件
  657. {
  658. get
  659. {
  660. return _勾选事件;
  661. }
  662. set
  663. {
  664. if (_勾选事件 == value)
  665. return;
  666. _勾选事件 = value;
  667. OnPropertyChanged("勾选事件");
  668. }
  669. }
  670. [Category("事件-内部触发"), Description("UnCheckedExec"), Browsable(true), PropertyOrder(5)]
  671. public string 取消勾选事件
  672. {
  673. get
  674. {
  675. return _取消勾选事件;
  676. }
  677. set
  678. {
  679. if (_取消勾选事件 == value)
  680. return;
  681. _取消勾选事件 = value;
  682. OnPropertyChanged("取消勾选事件");
  683. }
  684. }
  685. [Category("外部-内部接收消息集"), Description("EventReceiveNameList"), Browsable(true), PropertyOrder(2)]
  686. public ObservableCollection<EventReceiveMessage> 接收消息集
  687. {
  688. get
  689. {
  690. return _接收消息集;
  691. }
  692. set
  693. {
  694. if (_接收消息集 == value)
  695. return;
  696. _接收消息集 = value;
  697. OnPropertyChanged("接收消息集");
  698. }
  699. }
  700. private string _设备名称;
  701. [Category("*数据绑定模块*"), Description("DeviceName"), Browsable(true), PropertyOrder(2)]
  702. public string 设备名称
  703. {
  704. get
  705. {
  706. return _设备名称;
  707. }
  708. set
  709. {
  710. if (_设备名称 == value)
  711. return;
  712. _设备名称 = value;
  713. OnPropertyChanged("设备名称");
  714. }
  715. }
  716. private string _设备解析变量;
  717. [Category("*数据绑定模块*"), Description("DeviceValuleName"), Browsable(true), PropertyOrder(3)]
  718. public string 设备解析变量
  719. {
  720. get
  721. {
  722. return _设备解析变量;
  723. }
  724. set
  725. {
  726. if (_设备解析变量 == value)
  727. return;
  728. _设备解析变量 = value;
  729. OnPropertyChanged("设备解析变量");
  730. }
  731. }
  732. private InterfaceModeEnum _接口类型;
  733. [Category("*数据绑定模块*"), Description("InterfaceMode"), Browsable(true), PropertyOrder(4)]
  734. public InterfaceModeEnum 接口类型
  735. {
  736. get
  737. {
  738. return _接口类型;
  739. }
  740. set
  741. {
  742. if (_接口类型 == value)
  743. return;
  744. _接口类型 = value;
  745. OnPropertyChanged("接口类型");
  746. }
  747. }
  748. private string _接口参数;
  749. [Category("*数据绑定模块*"), Description("InterfaceParameters"), Browsable(true), PropertyOrder(5)]
  750. public string 接口参数
  751. {
  752. get
  753. {
  754. return _接口参数;
  755. }
  756. set
  757. {
  758. if (_接口参数 == value)
  759. return;
  760. _接口参数 = value;
  761. OnPropertyChanged("接口参数");
  762. }
  763. }
  764. private string _数据来源变量;
  765. [Category("*数据绑定模块*"), Description("DataSouceInformation"), Browsable(true), PropertyOrder(4)]
  766. public string 连接信息
  767. {
  768. get
  769. {
  770. return _数据来源变量;
  771. }
  772. set
  773. {
  774. if (_数据来源变量 == value)
  775. return;
  776. _数据来源变量 = value;
  777. OnPropertyChanged("连接信息");
  778. }
  779. }
  780. private string _数据源;
  781. [Category("*数据绑定模块*"), Description("FDataSouce"), Browsable(true), PropertyOrder(5)]
  782. public string 数据源
  783. {
  784. get
  785. {
  786. return _数据源;
  787. }
  788. set
  789. {
  790. if (_数据源 == value)
  791. return;
  792. _数据源 = value;
  793. OnPropertyChanged("数据源");
  794. }
  795. }
  796. private string _代码过滤脚本;
  797. [Category("*数据绑定模块*"), Description("Code"), Browsable(true), PropertyOrder(6)]
  798. public string 代码过滤脚本
  799. {
  800. get
  801. {
  802. return _代码过滤脚本;
  803. }
  804. set
  805. {
  806. if (_代码过滤脚本 == value)
  807. return;
  808. _代码过滤脚本 = value;
  809. OnPropertyChanged("代码过滤脚本");
  810. }
  811. }
  812. private string _数据结果;
  813. [Category("*数据绑定模块*"), Description("GenerateData"), Browsable(true), PropertyOrder(7)]
  814. public string 数据结果
  815. {
  816. get
  817. {
  818. return _数据结果;
  819. }
  820. set
  821. {
  822. if (_数据结果 == value)
  823. return;
  824. _数据结果 = value;
  825. OnPropertyChanged("数据结果");
  826. }
  827. }
  828. private int _定时调用;
  829. [Category("*数据绑定模块*"), Description("TimeCount"), Browsable(true), PropertyOrder(100)]
  830. public int 定时间隔
  831. {
  832. get
  833. {
  834. return _定时调用;
  835. }
  836. set
  837. {
  838. if (_定时调用 == value)
  839. return;
  840. _定时调用 = value;
  841. OnPropertyChanged("定时间隔");
  842. }
  843. }
  844. }
  845. }