private void SetDigitalOutputLevel(DOutputControl outputType, DigitalOutputLevel level) { int outputNumber = (int)outputType; int outputMask = (int)Math.Pow(2, outputNumber); RJSetOutputLevel(outputMask, (int)level); }
private void OnJobPrintEndEvent() { try { Record record = _queueRecords.First(); DigitalOutputLevel level = GetOutputLevelToBeSetForDataField(DOutputControl.SET_STACKER, record.Id); SetDigitalOutputLevel(DOutputControl.SET_STACKER, level); _queueRecords.Dequeue(); } catch (Exception) { } if (_stopLine == true) { SendToDashboard(MessageType.LOG, "Koniec bazy", $"Wydrukowano ostatni rekord: {DateTime.Now.ToString()}", null); RJStopJob(); ShowProblemSolution(ErrorType.printedLastRecord); } }
private DigitalOutputLevel GetOutputLevelToBeSetForDataField(DOutputControl outputType, double printedRecord) { DigitalOutputLevel level = DigitalOutputLevel.Low; int outputNumber = (int)outputType; try { int columnNumber = rjConnection.Outputs[outputNumber].DataField; if (columnNumber != -1) { List <string> record = database.GetRecordWithKey(printedRecord); string columnValue = record[columnNumber]; if (columnValue != "" && columnValue != null) { level = DigitalOutputLevel.High; } } } catch (Exception) { } return(level); }