예제 #1
0
파일: Module.cs 프로젝트: KH8/PlcAgent
 protected ExecutiveModule(uint id, string name, CommunicationInterfaceHandler communicationInterfaceHandler)
     : base(id, name)
 {
     CommunicationInterfaceHandler = communicationInterfaceHandler;
     InterfaceAssignmentCollection = new InterfaceAssignmentCollection();
     OnAssignmentUpdate += AssignmentFileUpdate;
 }
        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
        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
        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
        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)
 {
 }
 protected CommunicationInterfaceHandlerComponent(CommunicationInterfaceHandler communicationInterfaceHandler)
 {
     CommunicationInterfaceHandler = communicationInterfaceHandler;
     CommunicationInterfaceHandler.PropertyChanged += OnPropertyChangedEventHandler;
 }