Example #1
0
 public IList<Signal> SelectAll(String hostCode, String siteIdx)
 {
     var returns = new List<Signal>();
     var dt = SqlDbAccess.GetInstance().GetTable("select * from " + hostCode + "_TUnitIOC WHERE DACIdx = " + siteIdx);
     foreach (DataRow dr in dt.Rows)
     {
         var g = new Signal();
         g.FromDataRow(dr, hostCode);
         returns.Add(g);
     }
     return returns;
 }
Example #2
0
 public IList<Signal> SelectAll()
 {
     var returns = new List<Signal>();
     var dt = SqlDbAccess.GetInstance().GetTable("select * from  SZ01_TUnitIOC ");
     foreach (DataRow dr in dt.Rows)
     {
         var g = new Signal();
         g.FromDataRow(dr, "SZ01");
         returns.Add(g);
     }
     return returns;
 }
Example #3
0
 private void CreateInputTree()
 {
     var user = new UserInfo();
     user.Id = "InputUserName1";
     user.Name = MultilingualUtility.GetString("User");
     CreateNode(user, null);
     var host = new TDBHost();
     host.Name = MultilingualUtility.GetString("Host");
     host.Id = "InputHost1";
     CreateNode(host, null);
     var group = new Group();
     group.Id = "InputGroup1";
     group.Name = MultilingualUtility.GetString("Region");
     CreateNode(group, null);
     var site = new Site();
     site.Id = "InputSite1";
     site.Name = MultilingualUtility.GetString("Site");
     CreateNode(site, null);
     var equip = new Equipment();
     equip.Id = "InputEquipment1";
     equip.Name = MultilingualUtility.GetString("Equipment");
     CreateNode(equip, null);
     var signal = new Signal();
     signal.Id = "InputSignal1";
     signal.Name = MultilingualUtility.GetString("Signal");
     CreateNode(signal, null);
     var com = new Command();
     com.Id = "InputCommand1";
     com.Name = MultilingualUtility.GetString("Command");
     CreateNode(com, null);
     var comdo = new CommandDO();
     comdo.Id = "InputCommandDO1";
     comdo.Name = MultilingualUtility.GetString("CommandDO");
     CreateNode(comdo, null);
     var affair = new Affair();
     affair.Id = "InputAffair1";
     affair.Name = MultilingualUtility.GetString("Event");
     CreateNode(affair, null);
     var node = new Node();
     node.Id = "InputNode1";
     node.Name = MultilingualUtility.GetString("Node");
     CreateNode(node, null);
 }
Example #4
0
 private List<Int32> AddSignalNode(Equipment equipment, TreeNode parentNode)
 {
     var signalTags = new List<int>();
     var signals = DALFacade.GetSignalDAL(StorageTypeEnum.MongoDB).SelectAll(equipment.Code, equipment.Idx);
     var tempSignal = new Signal();
     tempSignal.Id = SPECIAL;
     tempSignal.Name = MultilingualUtility.GetString("Signal");
     var tempNode = CreateNode(tempSignal, parentNode);
     foreach (var signal in signals)
     {
         CreateNode(signal, tempNode);
         signalTags.Add(signal.Idx);
     }
     return signalTags;
 }
Example #5
0
 private void AddSignalNodeBySite(Site site, TreeNode parentNode)
 {
     var signalTags = new List<int>();
     var signals = DALFacade.GetSignalDAL(StorageTypeEnum.MongoDB).SelectAll(site.Code, site.Idx.ToString());
     var tempSignal = new Signal();
     tempSignal.Id = SPECIAL;
     tempSignal.Name = MultilingualUtility.GetString("Signal");
     var tempNode = CreateNode(tempSignal, parentNode);
     foreach (var signal in signals)
     {
         CreateNode(signal, tempNode);
         signalTags.Add(signal.Idx);
     }
     AddEventNode(site.Code, signalTags, parentNode);
     AddCommandNode(site.Code, signalTags, parentNode);
     AddCommandDONode(site.Code, signalTags, parentNode);
 }
Example #6
0
 public Signal Select(String hostCode, int idx)
 {
     var returns = new Signal();
     var dt = SqlDbAccess.GetInstance().GetTable("select * from " + hostCode + "_TUnitIOC WHERE Idx = " + idx);
     foreach (DataRow dr in dt.Rows)
     {
         returns.FromDataRow(dr, hostCode);
     }
     return returns;
 }
Example #7
0
 public void Save(Signal signal)
 {
     DALFacade.GetSignalDAL(StorageTypeEnum.MongoDB).SaveAll(new List<Signal>() { signal });
 }