コード例 #1
0
 public TCBlock(int id, Dictionary <string, TwincatVariable> dict, string filename, TwinCatCommunication comm)
 {
     m_id          = id;
     m_filename    = filename.Insert(filename.LastIndexOf('.'), id.ToString());
     parent        = comm;
     tcAds         = new TcAdsClient();
     notifications = new Dictionary <int, string>();
     IOparameters  = new IO_Parameters(dict);
 }
コード例 #2
0
        public TCBlock(int id, string fullFilename, TwinCatCommunication comm)
        {
            string path = Path.GetDirectoryName(fullFilename) + "\\";
            string filenameWithoutExt = Path.GetFileNameWithoutExtension(fullFilename);
            string filenameExt        = Path.GetExtension(fullFilename);

            m_id          = id;
            m_filename    = path + filenameWithoutExt + id + filenameExt;
            parent        = comm;
            notifications = new Dictionary <int, string>();
            IOparameters  = new IO_Parameters();
            tcAds         = new TcAdsClient();
            stringMaxSize = 80;

            LoadIOConf();
        }
コード例 #3
0
 public void AddIOParameters(IO_Parameters io)
 {
     foreach (KeyValuePair <string, IO_Parameter> kvpair in io.In)
     {
         if (!this.m_parametersIn.ContainsKey(kvpair.Key))
         {
             this.m_parametersIn[kvpair.Key] = kvpair.Value;
         }
     }
     foreach (KeyValuePair <string, IO_Parameter> kvpair in io.Out)
     {
         if (!this.m_parametersOut.ContainsKey(kvpair.Key))
         {
             this.m_parametersOut[kvpair.Key] = kvpair.Value;
         }
     }
 }