public void UpdateSelectedSmartGraphic(SmartGraphic SelectedSmartGraphic)
        {
            selectedSmartGraphic = new SmartGraphic();
            selectedSmartGraphic.analogInputSignalNames   = new List <JoinInfo>();
            selectedSmartGraphic.analogOutputSignalNames  = new List <JoinInfo>();
            selectedSmartGraphic.digitalInputSignalNames  = new List <JoinInfo>();
            selectedSmartGraphic.digitalOutputSignalNames = new List <JoinInfo>();
            selectedSmartGraphic.serialInputSignalNames   = new List <JoinInfo>();
            selectedSmartGraphic.serialOutputSignalNames  = new List <JoinInfo>();
            selectedSmartGraphic.onDebugMessageGenerated += SelectedSmartGraphic_onDebugMessageGenerated;

            selectedSmartGraphic = SelectedSmartGraphic;
            selectedSmartGraphic.analogInputSignalNames   = SelectedSmartGraphic.analogInputSignalNames;
            selectedSmartGraphic.analogOutputSignalNames  = SelectedSmartGraphic.analogOutputSignalNames;
            selectedSmartGraphic.digitalInputSignalNames  = SelectedSmartGraphic.digitalInputSignalNames;
            selectedSmartGraphic.digitalOutputSignalNames = SelectedSmartGraphic.digitalOutputSignalNames;
            selectedSmartGraphic.serialInputSignalNames   = SelectedSmartGraphic.serialInputSignalNames;
            selectedSmartGraphic.serialOutputSignalNames  = SelectedSmartGraphic.serialOutputSignalNames;
        }
Beispiel #2
0
        public void ProcessMetaData(string SGDFileContent)
        {
            metaData = SGDFileContent;
            if (metaData.Length > 0)
            {
                ///Takes SGD file and breaks it into sections - this will include both Smart graphic and non- Smart Graphic information sections
                splitMetaDataSections = SplitMetaDataIntoSections(metaData);    //Works
                //Console.WriteLine(splitMetaDataSections[1]);
                foreach (var section in splitMetaDataSections)
                {
                    //Console.WriteLine(section);
                    smartObjectData = SplitSectionsIntoSmartObjects(section);
                    Console.WriteLine(smartObjectData); //Works returns the section containing all the join information for the Smart Object

                    if (smartObjectData.Key != null && smartObjectData.Value != null)
                    {
                        smartGraphicToAdd = new SmartGraphic(smartObjectData.Value, sgdMetaDataHeader, sgdMetaDataFooter);
                        //Console.WriteLine(smartObjectData.Key);
                        smartGraphicToAdd.SetObjectName(smartObjectData.Key);
                        debbugsing = new FileOperations(string.Format(@"{0}\{1}", Directory.GetCurrentDirectory(), smartGraphicToAdd.objectName));
                        debbugsing.fileContents = smartObjectData.Value;
                        debbugsing.WriteToFile();
                        //Console.WriteLine(smartGraphicToAdd.objectName);
                        smartObjectList.Add(smartGraphicToAdd);
                        //Console.WriteLine("Number of Smart Objects in list is: {0}", smartObjectList.Count);
                        smartGraphicToAdd.onDebugMessageGenerated += SmartGraphicToAdd_onDebugMessageGenerated;
                    }
                }
                parsedSmartObjects.parsedSmartGraphicList = smartObjectList;
                parsedSmartObjects.isDebug = false;
                if (parsedSmartObjects != null)
                {
                    UpdateSmartObjects();
                }
            }
        }