コード例 #1
0
ファイル: Module.cs プロジェクト: KH8/PlcAgent
 protected ExecutiveModule(uint id, string name, CommunicationInterfaceHandler communicationInterfaceHandler)
     : base(id, name)
 {
     CommunicationInterfaceHandler = communicationInterfaceHandler;
     InterfaceAssignmentCollection = new InterfaceAssignmentCollection();
     OnAssignmentUpdate += AssignmentFileUpdate;
 }
コード例 #2
0
        public GuiCommunicationInterfaceConfiguration(CommunicationInterfaceHandler communicationHandler)
            : base(communicationHandler)
        {
            InitializeComponent();

            CommunicationInterfaceHandler.PlcCommunicator.PropertyChanged += OnConnectionStatusChanged;

            var words = CommunicationInterfaceHandler.PathFile.Path[CommunicationInterfaceHandler.Header.Id].Split('\\');
            InterfacePathBox.Text = words[words.Length - 1];
        }
コード例 #3
0
ファイル: DbConnectionHandler.cs プロジェクト: KH8/PlcAgent
        public DbConnectionHandler(uint id, string name, CommunicationInterfaceHandler communicationInterfaceHandler, DbConnectionHandlerFile dbConnectionHandlerFile, DbConnectionHandlerInterfaceAssignmentFile dbConnectionHandlerInterfaceAssignmentFile)
            : base(id, name, communicationInterfaceHandler)
        {
            DbConnectionHandlerFile = dbConnectionHandlerFile;
            DbConnectionHandlerInterfaceAssignmentFile = dbConnectionHandlerInterfaceAssignmentFile;

            StoredProcedures = new DbStoredProcedureList(this);

            if (dbConnectionHandlerInterfaceAssignmentFile.Assignment == null) dbConnectionHandlerInterfaceAssignmentFile.Assignment = new string[9][];
            Assignment = dbConnectionHandlerInterfaceAssignmentFile.Assignment[Header.Id];
            CreateInterfaceAssignment();
        }
コード例 #4
0
ファイル: OutputFileCreator.cs プロジェクト: KH8/PlcAgent
        public OutputFileCreator(uint id, string name, CommunicationInterfaceHandler communicationInterfaceHandler, OutputDataTemplate outputDataTemplate, OutputFileCreatorFile outputFileCreatorFile, OutputFileCreatorInterfaceAssignmentFile outputFileCreatorInterfaceAssignmentFile)
            : base(id, name, communicationInterfaceHandler, outputDataTemplate)
        {
            OutputFileCreatorFile = outputFileCreatorFile;
            OutputFileCreatorInterfaceAssignmentFile = outputFileCreatorInterfaceAssignmentFile;

            _communicationThread = new Thread(OutputCommunicationThread);
            _communicationThread.SetApartmentState(ApartmentState.STA);
            _communicationThread.IsBackground = true;

            if (OutputFileCreatorInterfaceAssignmentFile.Assignment == null) OutputFileCreatorInterfaceAssignmentFile.Assignment = new string[9][];
            Assignment = OutputFileCreatorInterfaceAssignmentFile.Assignment[Header.Id];
            CreateInterfaceAssignment();
        }
コード例 #5
0
ファイル: Analyzer.cs プロジェクト: KH8/PlcAgent
        public Analyzer(uint id, string name, CommunicationInterfaceHandler communicationInterfaceHandler, AnalyzerAssignmentFile analyzerAssignmentFile, AnalyzerSetupFile analyzerSetupFile)
            : base(id, name, communicationInterfaceHandler)
        {
            PcControlModeChangeAllowed = true;
            PcControlMode = false;

            CommunicationInterfaceHandler.OnInterfaceUpdatedDelegate += Clear;

            AnalyzerAssignmentFile = analyzerAssignmentFile;
            AnalyzerSetupFile = analyzerSetupFile;

            TimeObservableVariable = new AnalyzerObservableVariable(this, new CiInteger("Time", 0, CommunicationInterfaceComponent.VariableType.Integer, 0))
            {
                MainViewModel = new TimeMainViewModel(),
                Brush = Brushes.Black
            };

            AnalyzerChannels = new AnalyzerChannelList(0, this);
            AnalyzerChannels.RetriveConfiguration();

            AnalyzerDataCursorRed = new GuiAnalyzerDataCursor(this)
            {
                Brush = Brushes.Red
            };
            AnalyzerDataCursorBlue = new GuiAnalyzerDataCursor(this)
            {
                Brush = Brushes.Blue
            };

            AnalyzerDataCursorPointCollection = new AnalyzerDataCursorPointCollection();

            TimeRange = AnalyzerSetupFile.TimeRange[Header.Id];
            DataCursorsVisibility = AnalyzerSetupFile.ShowDataCursors[Header.Id] ? Visibility.Visible : Visibility.Hidden;

            AnalyzerCsvHandler = new AnalyzerCsvHandler(this);

            _analysisThread = new Thread(AnalyzeThread);
            _analysisThread.SetApartmentState(ApartmentState.STA);
            _analysisThread.IsBackground = true;

            _communicationThread = new Thread(OutputCommunicationThread);
            _communicationThread.SetApartmentState(ApartmentState.STA);
            _communicationThread.IsBackground = true;

            if (AnalyzerAssignmentFile.Assignment == null) AnalyzerAssignmentFile.Assignment = new string[9][];
            Assignment = AnalyzerAssignmentFile.Assignment[Header.Id];
            CreateInterfaceAssignment();
        }
コード例 #6
0
ファイル: VFlashHandler.cs プロジェクト: KH8/PlcAgent
        public VFlashHandler(uint id, string name, CommunicationInterfaceHandler communicationInterfaceHandler, VFlashTypeBank vFlashTypeBank, VFlashHandlerInterfaceAssignmentFile vFlashHandlerInterfaceAssignmentFile)
            : base(id, name, communicationInterfaceHandler)
        {
            VFlashHandlerInterfaceAssignmentFile = vFlashHandlerInterfaceAssignmentFile;

            _vFlashErrorCollector = new VFlashErrorCollector();
            _vFlashTypeBank = vFlashTypeBank;

            _vFlashThread = new Thread(VFlashPlcCommunicationThread);
            _vFlashThread.SetApartmentState(ApartmentState.STA);
            _vFlashThread.IsBackground = true;

            if (VFlashHandlerInterfaceAssignmentFile.Assignment == null) VFlashHandlerInterfaceAssignmentFile.Assignment = new string[9][];
            Assignment = VFlashHandlerInterfaceAssignmentFile.Assignment[Header.Id];
            CreateInterfaceAssignment();
        }
コード例 #7
0
ファイル: Module.cs プロジェクト: KH8/PlcAgent
 protected OutputModule(uint id, string name, CommunicationInterfaceHandler communicationInterfaceHandler, OutputDataTemplate outputDataTemplate)
     : base(id, name, communicationInterfaceHandler)
 {
     OutputDataTemplate = outputDataTemplate;
 }
コード例 #8
0
ファイル: Module.cs プロジェクト: KH8/PlcAgent
 protected InputModule(uint id, string name, CommunicationInterfaceHandler communicationInterfaceHandler)
     : base(id, name, communicationInterfaceHandler)
 {
 }
コード例 #9
0
 protected CommunicationInterfaceHandlerComponent(CommunicationInterfaceHandler communicationInterfaceHandler)
 {
     CommunicationInterfaceHandler = communicationInterfaceHandler;
     CommunicationInterfaceHandler.PropertyChanged += OnPropertyChangedEventHandler;
 }