Esempio n. 1
0
        //*Class Constructor -- Note Currently only set up for stage signal control different coding required for flow control
        public SignalsSet(SnmpConnect A, List <string> NodeNames)//NOTE: rather that passing NodeNames it would be better to extract info from model files if possible
        {
            Sconnect = A;

            try
            {
                Sconnect.PCont.ParseNodes(ref Sconnect.Path);//Double check nodes data are loaded

                foreach (string Nd in NodeNames)
                {
                    string[]   Ndlist    = Nd.Split(',');
                    List <int> NodeCodes = new List <int>();

                    foreach (string Ndf in Ndlist)
                    {
                        string NdfN   = Ndf;
                        int    NodeID = Sconnect.PCont.AddSignalNodeControlRow(ref NdfN);
                        //int FlowID = Sconnect.PCont.AddSignalFlowControlRow(ref Ndf);
                        if (NodeID == 0)
                        {
                            throw new Exception("Signal junction node with name " + Nd + " was not detected or added to the MiB");
                        }
                        NodeCodes.Add(NodeID);
                    }
                    SignalNode temp = new SignalNode(Nd, NodeCodes);
                    SigNodes.Add(temp);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        //*Class Constructor
        public DetectorRead(SnmpConnect A)
        {
            Sconnect = A;

            try
            {
                Sconnect.PCont.ParseDetectors(ref Sconnect.Path);                                              //Double check that detector data are in PCont object

                ParamicsPuppetMaster.EditDetectors ED = new ParamicsPuppetMaster.EditDetectors(Sconnect.Path); // Get detector info from paramics network


                foreach (ParamicsPuppetMaster.Detector Dt in ED.DetectorList)// Add a line to the MiB for each detector
                {
                    int IDR = Sconnect.PCont.AddDetectorControlRow(ref Dt.Name);
                    DInfo.Add(new DetectorInfo(Dt, IDR));
                    if (IDR == 0)
                    {
                        throw new Exception("Error: Detector named " + Dt.Name + " was not detected and a control row was not added to the MiB");
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Esempio n. 3
0
 //*Class Constructor
 public Runner(Coordinate B)
 {
     Processor = B;
     Connector = Processor.NetDat;
 }