示例#1
0
 public void CommServerConfigurationMainCreatorTest()
 {
     using (CommServerConfigurationMain _new = new CommServerConfigurationMain())
     {
         using (ComunicationNet _defaultCommunicationNet = _new.Configuartion)
         {
             Assert.IsNotNull(_defaultCommunicationNet);
             Assert.IsNotNull(_defaultCommunicationNet.Channels);
             Assert.IsNotNull(_defaultCommunicationNet.DataBlocks);
             Assert.IsNotNull(_defaultCommunicationNet.Groups);
             Assert.IsNotNull(_defaultCommunicationNet.Interfaces);
             Assert.IsNotNull(_defaultCommunicationNet.ItemPropertiesTable);
             Assert.IsNotNull(_defaultCommunicationNet.Protocol);
             Assert.IsNotNull(_defaultCommunicationNet.Relations);
             Assert.IsNotNull(_defaultCommunicationNet.Relations);
             Assert.IsNotNull(_defaultCommunicationNet.Segments);
             Assert.IsNotNull(_defaultCommunicationNet.SerialSetings);
             Assert.IsNotNull(_defaultCommunicationNet.Station);
             Assert.IsNotNull(_defaultCommunicationNet.TagBit);
             Assert.IsNotNull(_defaultCommunicationNet.Tags);
         }
         Assert.IsNull(_new.Container);
         Assert.AreEqual <string>(@"CommServerConfiguration", _new.DefaultFileName);
         Assert.IsNotNull(_new.Menu);
         Assert.IsNotNull(_new.OpenFileDialog);
     }
 }
示例#2
0
 public ImportScanSettings(ComunicationNet database, System.Windows.Forms.Form parrent_form)
     : base(parrent_form)
 {
     m_database = database;
     m_ImportScanSettingsInfo = new ImportScanSettingsInfo();
     SetImportInfo(m_ImportScanSettingsInfo);
 }
示例#3
0
 public ImportTagBits(ComunicationNet database, Form parentForm)
     : base(parentForm)
 {
     m_database          = database;
     m_ImportTagBitsInfo = new ImportTagBitsInfo();
     SetImportInfo(m_ImportTagBitsInfo);
 }
示例#4
0
 public AddInterfaceAndStation
     (ComunicationNet pDB, IAction pNewInteface)
 {
     InitializeComponent();
     m_InterfacesDataTable      = pDB.Interfaces;
     StationTab                 = pDB.Station;
     pgInterface.SelectedObject = pNewInteface;
 }
        internal static TreeNode CreateNode(ComunicationNet dataset)
        {
            SA_TopWrapper newWrapper = new SA_TopWrapper(dataset);
            TreeNode      cWTN       = newWrapper.AddActionTreeNode(7, 7);

            newWrapper.CreateNodes();
            return(cWTN);
        }
示例#6
0
 /// <summary>
 /// Creator for the Tag collection Form
 /// </summary>
 /// <param name="pBlock">Block (<see cref="ComunicationNet.DataBlocksRow"/> to dispaly</param>
 /// <param name="DataBlockRowWrapper">The data block row wrapper.</param>
 internal TagsCollection(ComunicationNet.DataBlocksRow pBlock, DataBlocksRowWrapper DataBlockRowWrapper)
     : this()
 {
     dataBlockRowWrapper = DataBlockRowWrapper;
     m_ParBlock          = pBlock;
     m_DB = pBlock.Table.DataSet as ComunicationNet;
     m_DB.Tags.AcceptChanges();
     m_DB.TagBit.AcceptChanges();
     m_DB.ItemPropertiesTable.AcceptChanges();
     FillLlist(0);
 }
 internal AdvancedFormNetworkConfig(ComunicationNet _configmanagemet, ConfigIOHandler _fileread, ConfigIOHandler _filesave, ConfigIOHandler _fileclear)
 {
     InitializeComponent();
     //this.configDataBase = new NetworkConfig.ComunicationNet();
     this.configDataBase = _configmanagemet;
     InitConfigDataBase(false);
     InitializeAdvanceComponent();
     this.fileread  = _fileread;
     this.filesave  = _filesave;
     this.fileclear = _fileclear;
     //this.configDataBase = NetworkConfig.HMI.ConfigurationManagement.configDataBase;
 }
示例#8
0
 internal CommServerConfigurationMain(IContainer components)
 {
     components.Add(this);
     Configuartion  = new ComunicationNet();
     OpenFileDialog = new OpenFileDialog()
     {
         InitialDirectory             = InstallContextNames.ApplicationDataPath,
         DefaultExt                   = "xml",
         FileName                     = "CommServerConfiguration",
         Filter                       = "CommServer Configuration File (*.xml)|*.xml|All files(*.*)|*.*",
         SupportMultiDottedExtensions = true,
         Title = "Open CommServer Configuration File"
     };
     ((ISupportInitialize)(Configuartion)).BeginInit();
     Configuartion.DataSetName             = "ComunicationNet";
     Configuartion.Locale                  = new CultureInfo("en-US");
     Configuartion.SchemaSerializationMode = SchemaSerializationMode.IncludeSchema;
     ((ISupportInitialize)(Configuartion)).EndInit();
 }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProtocolHubConfiguration"/> class.
 /// </summary>
 /// <param name="ConfigurationFilename">The configuration filename.</param>
 /// <param name="open_readonly">if set to <c>true</c> file is opened as read only.</param>
 public ProtocolHubConfiguration(string ConfigurationFilename, bool open_readonly)
 {
     filename = ConfigurationFilename;
     try
     {
         configuration = new ComunicationNet();
         this.configuration.BeginInit();
         this.configuration.DataSetName = "ComunicationNet";
         this.configuration.Locale      = new System.Globalization.CultureInfo("en-US");
         this.configuration.EndInit();
         XML2DataSetIO.readXMLFile(configuration, filename, open_readonly);
     }
     catch (System.IO.IOException ioex)
     {
         EventLogMonitor.WriteToEventLogError("Problem with CommServer configuration file:" + ioex.Message, (int)Error.CommServer_Configuration);
     }
     catch (Exception ex)
     {
         string _path = Environment.CurrentDirectory;
         EventLogMonitor.WriteToEventLogError($"Problem with CommServer XML configuration file : {filename} - in directory: {_path } error: {ex.ToString()}", (int)Error.CommServer_Configuration);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConfigurationEventArg"/> class.
 /// </summary>
 /// <param name="config">The communication network configuration.</param>
 public ConfigurationEventArg(ComunicationNet config)
 {
     Configuration = config;
 }
 public ImportBlockCSV(ComunicationNet database, Form parentForm) : base(parentForm)
 {
     m_Database           = database;
     m_ImportBlockCSVInfo = new ImportBlockCSVInfo();
     SetImportInfo(m_ImportBlockCSVInfo);
 }
 private SA_TopWrapper(ComunicationNet dataset)
     : base(dataset)
 {
 }
 public TopWrapper(ComunicationNet dataset)
     : base(null)
 {
     m_dataset = dataset;
 }
示例#14
0
        public ConfigTreeView(ComunicationNet configDataBase, ConfigIOHandler fileread, ConfigIOHandler filesave, ConfigIOHandler fileclear, bool AdvanceMenu)
        {
            LicenseManager.IsValid(this.GetType(), this, out License lic);
            m_license = lic as LicenseFile;
            if (m_license == null)
            {
                MessageBox.Show(CAS.Lib.CodeProtect.Properties.Resources.Tx_LicNoFileErr, CAS.Lib.CodeProtect.Properties.Resources.Tx_LicCap, MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            else
            {
                if (m_license.FailureReason != string.Empty)
                {
                    ScrollableMessageBox.Instance.Show(m_license.FailureReason, CAS.Lib.CodeProtect.Properties.Resources.Tx_LicCap, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
                else
                {
                    m_DemoVer = false;
                }
            }
            if (m_DemoVer)
            {
                MessageBox.Show
                    (CAS.Lib.CodeProtect.Properties.Resources.Tx_LicDemoModeInfo, CAS.Lib.CodeProtect.Properties.Resources.Tx_LicCap, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.m_FileSave = new ConfigIOHandler(ConfigurationManagement.SaveDemoProc);
            }
            else
            {
                m_UAPackage     = m_license.Product.ShortName.ToLower().Contains("ua");
                this.m_FileSave = filesave;
            }
            m_configDataBase = configDataBase;
            this.m_FileRead  = fileread;
            this.m_FileClear = fileclear;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            //navigation and search toolstrip initialisation
            this.backForwardTreViewToolStrip1.TreeView = m_PNavigator.cn_TreeView;
            this.searchTreeViewToolStrip1.TreeView     = m_PNavigator.cn_TreeView;
            //other
            TreeBuilder.CreateTree(m_configDataBase, m_PNavigator.cn_TreeView);
            IntTreeViewCheckBoxes();
#if UNDOREDO
            tlog = new RTLib.DataBase.UndoRedo.UndoRedoMenager();
            tlog.SourceDataSet            = (DataSet)m_configDataBase;
            tlog.RedoUndoOperationAdding += new RTLib.DataBase.UndoRedo.UndoRedoMenager.OperationDlgt(OnRedoUndoOperationAdding);
            tlog.RedoUndoOperationAdded  += new RTLib.DataBase.UndoRedo.UndoRedoMenager.OperationDlgt(OnRedoUndoOperationAdded);
            foreach (DataTable dt in m_configDataBase.Tables)
            {
                dt.ColumnChanging += new DataColumnChangeEventHandler(OnColumnChanging);
                dt.RowChanging    += new DataRowChangeEventHandler(OnRowChanging);
            }
#else
            undoCtrlZToolStripMenuItem.Enabled = false;
            redoCtrlYToolStripMenuItem.Enabled = false;
#endif
            foreach (DataTable dt in m_configDataBase.Tables)
            {
                dt.RowChanged += new DataRowChangeEventHandler(configDataBaseDataTable_Changed);
            }
            m_PNavigator.cn_TreeView.AfterSelect += new TreeViewEventHandler(cn_TreeView_AfterSelect);
            m_PNavigator.cn_TreeView.KeyDown     += new KeyEventHandler(cn_TreeView_KeyDown);
            m_PNavigator.cn_TreeView.MouseDown   += new MouseEventHandler(cn_TreeView_MouseDown);
            tsbUndo.Enabled                = false;
            tsbRedo.Enabled                = false;
            saveToolStripButton.Enabled    = false;
            saveToolStripMenuItem.Enabled  = false;
            ActionBase.SetCommonBusControl = cm_commonBusControl;
            if (!AdvanceMenu)
            {
                toolsToolStripMenuItem_Tools.Enabled = false;
                toolsToolStripMenuItem_Tools.Visible = false;
            }
        }
 public void Refresh(ComunicationNet myConfig)
 {
     myConfig.AcceptChanges();
     TreeBuilder.CreateTree(myConfig, cn_TreeView);
     base.Refresh();
 }