Esempio n. 1
0
        private void OnConnect(ReaPi.ConnectionIdentifier connectionId)
        {
            string lastError = "";

            rjConnection.ProtocolVersion = new Version(ReaPi.GetProtocolVersion(rjConnection.ConnectionID));

            lastError = ReaPi.SubscribeJobSet(rjConnection.ConnectionID, 1).ToString();
            lastError = ReaPi.SubscribeIOConfigurationSet(rjConnection.ConnectionID, 1).ToString();
            lastError = ReaPi.GetIOOutputLevel(rjConnection.ConnectionID).ToString();

            //SetOutputLevel(OutputTypeReaction.ControlDivert, OutputLevel.Low);
            //SetOutputLevel(OutputTypeReaction.ControlStacker, OutputLevel.Low);

            SendToDashboard(MessageType.LOG, "Połączenie: OK", $" Wskaźnik połączenia: {rjConnection.ConnectionID.ToString()}.", null);
            SendToDashboard(MessageType.ERROR, lastError, null, null);
            UpdateDashboard(EventType.CONNECT);
        }
Esempio n. 2
0
        private void OnJobSetEvent(ReaPi.ConnectionIdentifier connection, int job, string jobFileName)
        {
            SendToDashboard(MessageType.EVENT, $"Job: <{jobFileName}>", null, null);

            if (!string.IsNullOrEmpty(jobFileName))
            {
                try
                {
                    rjConnection.Job = new RJJob(job, jobFileName);

                    if (rjConnection.Job.VariableContents.Count > 0)
                    {
                        ISet <string> groups = rjConnection.Job.GetGroups();
                        //subskrypcja dla każdej grupy
                        foreach (var group in groups)
                        {
                            ReaPi.SubscribeInvalidContent(connection, job, group).ToString();
                            ReaPi.SubscribeBufferFull(connection, job, group).ToString();
                        }
                    }
                }
                catch (Exception) { }

                string logError;

                logError  = ReaPi.SubscribeJobStarted(connection, job).ToString();
                logError += ReaPi.SubscribeJobStopped(connection, job).ToString();
                logError += ReaPi.SubscribeIOConfigurationSet(connection, job).ToString();
                logError += ReaPi.SubscribePrintTrigger(connection, job).ToString();
                logError += ReaPi.SubscribePrintStart(connection, job).ToString();
                logError += ReaPi.SubscribePrintRejected(connection, job).ToString();
                logError += ReaPi.SubscribePrintEnd(connection, job).ToString();
                logError += ReaPi.SubscribePrintAborted(connection, job).ToString();
                logError += ReaPi.SubscribePrintSpeedError(connection, job).ToString();
                logError += ReaPi.SubscribeMissingContent(connection, job).ToString();

                SendToDashboard(MessageType.ERROR, logError, "", "");
            }
            else
            {
                ShowProblemSolution(ErrorType.nullJob);
            }
        }