/**
* File Auto-Generated by the RICADO Gen 4 PHP API Project
*
* Do Not Edit this File Manually!
*/
import BaseModel from '../../../Models/BaseModel';
/**
* Model Class for a Reject Bin Scale
*
* @class
* @hideconstructor
* @extends BaseModel
*/
class RejectBinScaleModel extends BaseModel
{
/**
* RejectBinScaleModel Constructor
*
* @protected
* @param {number} siteId The Site ID associated with this Reject Bin Scale
*/
constructor(siteId)
{
super();
/**
* The Reject Bin Scale ID
*
* @type {string}
* @public
*/
this.id = "";
/**
* The RTU this Reject Bin Scale belongs to
*
* @type {?number}
* @public
*/
this.rtuId = null;
/**
* The Name of this Reject Bin Scale
*
* @type {string}
* @public
*/
this.name = "";
/**
* The Points used by this Reject Bin Scale
*
* @type {{weighButton: ?number, packrunButton: ?number, manualInterventionButton: ?number, clearIndicator: ?number, busyIndicator: ?number, packrunIndicator: ?number, manualInterventionIndicator: ?number, sirenControl: ?number, scaleTareRequest: ?number, scaleClearTareRequest: ?number, scaleZeroRequest: ?number, scaleStableStatus: number, scaleWeight: ?number, scaleNetWeight: ?number, scaleGrossWeight: ?number, scaleTareWeight: ?number, targetGrossWeight: ?number, currentLiveWeight: ?number, startLiveWeighingRequest: ?number, finishLiveWeighingRequest: ?number, fruitDeliveryActive: ?number, status: number, currentPackrunId: number, nextPackrunId: number, currentPackrunName: number, nextPackrunName: number, incorrectOperationStatus: ?number, currentPackrunIncorrectOperationsCount: ?number, totalIncorrectOperationsCount: ?number, manualInterventionStatus: ?number, currentPackrunManualInterventionsCount: ?number, totalManualInterventionsCount: ?number, currentPackrunBinsWeighedCount: number, totalBinsWeighedCount: number}}
* @public
*/
this.points = (function(){
let pointsDefaultValue = {};
pointsDefaultValue.weighButton = null;
pointsDefaultValue.packrunButton = null;
pointsDefaultValue.manualInterventionButton = null;
pointsDefaultValue.clearIndicator = null;
pointsDefaultValue.busyIndicator = null;
pointsDefaultValue.packrunIndicator = null;
pointsDefaultValue.manualInterventionIndicator = null;
pointsDefaultValue.sirenControl = null;
pointsDefaultValue.scaleTareRequest = null;
pointsDefaultValue.scaleClearTareRequest = null;
pointsDefaultValue.scaleZeroRequest = null;
pointsDefaultValue.scaleStableStatus = 0;
pointsDefaultValue.scaleWeight = null;
pointsDefaultValue.scaleNetWeight = null;
pointsDefaultValue.scaleGrossWeight = null;
pointsDefaultValue.scaleTareWeight = null;
pointsDefaultValue.targetGrossWeight = null;
pointsDefaultValue.currentLiveWeight = null;
pointsDefaultValue.startLiveWeighingRequest = null;
pointsDefaultValue.finishLiveWeighingRequest = null;
pointsDefaultValue.fruitDeliveryActive = null;
pointsDefaultValue.status = 0;
pointsDefaultValue.currentPackrunId = 0;
pointsDefaultValue.nextPackrunId = 0;
pointsDefaultValue.currentPackrunName = 0;
pointsDefaultValue.nextPackrunName = 0;
pointsDefaultValue.incorrectOperationStatus = null;
pointsDefaultValue.currentPackrunIncorrectOperationsCount = null;
pointsDefaultValue.totalIncorrectOperationsCount = null;
pointsDefaultValue.manualInterventionStatus = null;
pointsDefaultValue.currentPackrunManualInterventionsCount = null;
pointsDefaultValue.totalManualInterventionsCount = null;
pointsDefaultValue.currentPackrunBinsWeighedCount = 0;
pointsDefaultValue.totalBinsWeighedCount = 0;
return pointsDefaultValue;
}());
/**
* The Packing Line that owns this Reject Bin Scale
*
* @type {string}
* @public
*/
this.packingLineId = "";
/**
* The Permanent Object that provides the Next Packrun for this Reject Bin Scale
*
* @type {?string}
* @public
*/
this.packrunSourceId = null;
/**
* The Packrun Group this Reject Bin Scale is a part of
*
* @type {?number}
* @public
*/
this.packrunGroup = null;
/**
* An Array of Sources that deliver Fruit to this Reject Bin Scale
*
* @type {Array<{type: string, sortingTableId: string, classType: string, varietyClassTypes: Array<{varietyId: string, classType: string}>}|{type: string, beltName: ?string, classType: string, varietyClassTypes: Array<{varietyId: string, classType: string}>}|{type: string, sizerId: string, outletNumber: number}>}
* @public
*/
this.sources = [];
/**
* The Auto Packrun Change Configuration for this Reject Bin Scale
*
* @type {?{delay: ?number}}
* @public
*/
this.autoPackrunChange = null;
/**
* Whether this Reject Bin Scale supports Live Weighing
*
* @type {?boolean}
* @public
*/
this.supportsLiveWeighing = null;
/**
* The Minimum Weight Change Required to Automatically Start Live Weighing
*
* @type {?number}
* @public
*/
this.autoWeighingStartThreshold = null;
/**
* The Delay in Milliseconds before Auto Live Weighing would Start
*
* @type {?number}
* @public
*/
this.autoWeighingStartDelay = null;
/**
* The Minimum Weight Change Required to Automatically Finish Live Weighing
*
* @type {?number}
* @public
*/
this.autoWeighingFinishThreshold = null;
/**
* The Delay in Milliseconds before Auto Live Weighing would Finish
*
* @type {?number}
* @public
*/
this.autoWeighingFinishDelay = null;
/**
* Whether Live Weighing should be Automatically Finished when the Target Gross Weight is Met
*
* @type {?boolean}
* @public
*/
this.autoWeighingFinishAtGrossTarget = null;
/**
* The Maximum Duration in Milliseconds before a Manual Intervention would end
*
* @type {?number}
* @public
*/
this.manualInterventionMaximumDuration = null;
/**
* The Maximum Weight Increase allowed within a single Live Weighing Update Interval
*
* @type {?number}
* @public
*/
this.liveWeighingIncreaseTolerance = null;
/**
* The Maximum Weight Decrease allowed within a single Live Weighing Update Interval
*
* @type {?number}
* @public
*/
this.liveWeighingDecreaseTolerance = null;
/**
* The Interval in Milliseconds between Live Weighing Updates
*
* @type {?number}
* @public
*/
this.liveWeighingUpdateInterval = null;
/**
* Whether the Loadcell Stable Status is used to ignore Changes during Live Weighing
*
* @type {?boolean}
* @public
*/
this.liveWeighingUsesStableStatus = null;
/**
* The Maximum Weight Change allowed while Live Weighing before an Incorrect Operation is Logged
*
* @type {?number}
* @public
*/
this.incorrectOperationTolerance = null;
/**
* The FreshPack Integration Configuration for this Reject Bin Scale
*
* @type {?{points: Object, enabled: boolean, materialGroupId: ?number, binTypeId: number, printerGroupId: ?number, binCardPrintingEnabled: boolean, useWindowsDriverApi: boolean}}
* @public
*/
this.freshPackIntegration = null;
/**
* Whether the Reject Bin Scale has been deleted
*
* @type {boolean}
* @public
*/
this.deleted = false;
/**
* When the Reject Bin Scale was last updated
*
* @type {Date}
* @public
*/
this.updateTimestamp = new Date();
/**
* The Site ID associated with this Reject Bin Scale
*
* @type {number}
* @public
*/
this.siteId = siteId;
}
/**
* Create a new **RejectBinScaleModel** from a JSON Object or JSON String
*
* @static
* @public
* @param {Object<string, any>|string} json A JSON Object or JSON String
* @param {number} siteId The Site ID associated with this Reject Bin Scale
* @return {RejectBinScaleModel}
*/
static fromJSON(json, siteId)
{
let model = new RejectBinScaleModel(siteId);
/**
* The JSON Object
*
* @type {Object<string, any>}
*/
let jsonObject = {};
if(typeof json === 'string')
{
jsonObject = JSON.parse(json);
}
else if(typeof json === 'object')
{
jsonObject = json;
}
if('id' in jsonObject)
{
model.id = (function(){
if(typeof jsonObject['id'] !== 'string')
{
return String(jsonObject['id']);
}
return jsonObject['id'];
}());
}
if('rtuId' in jsonObject)
{
model.rtuId = (function(){
if(jsonObject['rtuId'] === null)
{
return null;
}
if(typeof jsonObject['rtuId'] !== 'number')
{
return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
}
return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
}());
}
if('name' in jsonObject)
{
model.name = (function(){
if(typeof jsonObject['name'] !== 'string')
{
return String(jsonObject['name']);
}
return jsonObject['name'];
}());
}
if('points' in jsonObject)
{
model.points = (function(){
let pointsObject = {};
if(typeof jsonObject['points'] === 'object' && 'weighButton' in jsonObject['points'])
{
pointsObject.weighButton = (function(){
if(jsonObject['points'].weighButton === null)
{
return null;
}
if(typeof jsonObject['points'].weighButton !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].weighButton)) ? Number(jsonObject['points'].weighButton) : Math.floor(Number(jsonObject['points'].weighButton));
}
return Number.isInteger(jsonObject['points'].weighButton) ? jsonObject['points'].weighButton : Math.floor(jsonObject['points'].weighButton);
}());
}
else
{
pointsObject.weighButton = null;
}
if(typeof jsonObject['points'] === 'object' && 'packrunButton' in jsonObject['points'])
{
pointsObject.packrunButton = (function(){
if(jsonObject['points'].packrunButton === null)
{
return null;
}
if(typeof jsonObject['points'].packrunButton !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].packrunButton)) ? Number(jsonObject['points'].packrunButton) : Math.floor(Number(jsonObject['points'].packrunButton));
}
return Number.isInteger(jsonObject['points'].packrunButton) ? jsonObject['points'].packrunButton : Math.floor(jsonObject['points'].packrunButton);
}());
}
else
{
pointsObject.packrunButton = null;
}
if(typeof jsonObject['points'] === 'object' && 'manualInterventionButton' in jsonObject['points'])
{
pointsObject.manualInterventionButton = (function(){
if(jsonObject['points'].manualInterventionButton === null)
{
return null;
}
if(typeof jsonObject['points'].manualInterventionButton !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].manualInterventionButton)) ? Number(jsonObject['points'].manualInterventionButton) : Math.floor(Number(jsonObject['points'].manualInterventionButton));
}
return Number.isInteger(jsonObject['points'].manualInterventionButton) ? jsonObject['points'].manualInterventionButton : Math.floor(jsonObject['points'].manualInterventionButton);
}());
}
else
{
pointsObject.manualInterventionButton = null;
}
if(typeof jsonObject['points'] === 'object' && 'clearIndicator' in jsonObject['points'])
{
pointsObject.clearIndicator = (function(){
if(jsonObject['points'].clearIndicator === null)
{
return null;
}
if(typeof jsonObject['points'].clearIndicator !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].clearIndicator)) ? Number(jsonObject['points'].clearIndicator) : Math.floor(Number(jsonObject['points'].clearIndicator));
}
return Number.isInteger(jsonObject['points'].clearIndicator) ? jsonObject['points'].clearIndicator : Math.floor(jsonObject['points'].clearIndicator);
}());
}
else
{
pointsObject.clearIndicator = null;
}
if(typeof jsonObject['points'] === 'object' && 'busyIndicator' in jsonObject['points'])
{
pointsObject.busyIndicator = (function(){
if(jsonObject['points'].busyIndicator === null)
{
return null;
}
if(typeof jsonObject['points'].busyIndicator !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].busyIndicator)) ? Number(jsonObject['points'].busyIndicator) : Math.floor(Number(jsonObject['points'].busyIndicator));
}
return Number.isInteger(jsonObject['points'].busyIndicator) ? jsonObject['points'].busyIndicator : Math.floor(jsonObject['points'].busyIndicator);
}());
}
else
{
pointsObject.busyIndicator = null;
}
if(typeof jsonObject['points'] === 'object' && 'packrunIndicator' in jsonObject['points'])
{
pointsObject.packrunIndicator = (function(){
if(jsonObject['points'].packrunIndicator === null)
{
return null;
}
if(typeof jsonObject['points'].packrunIndicator !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].packrunIndicator)) ? Number(jsonObject['points'].packrunIndicator) : Math.floor(Number(jsonObject['points'].packrunIndicator));
}
return Number.isInteger(jsonObject['points'].packrunIndicator) ? jsonObject['points'].packrunIndicator : Math.floor(jsonObject['points'].packrunIndicator);
}());
}
else
{
pointsObject.packrunIndicator = null;
}
if(typeof jsonObject['points'] === 'object' && 'manualInterventionIndicator' in jsonObject['points'])
{
pointsObject.manualInterventionIndicator = (function(){
if(jsonObject['points'].manualInterventionIndicator === null)
{
return null;
}
if(typeof jsonObject['points'].manualInterventionIndicator !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].manualInterventionIndicator)) ? Number(jsonObject['points'].manualInterventionIndicator) : Math.floor(Number(jsonObject['points'].manualInterventionIndicator));
}
return Number.isInteger(jsonObject['points'].manualInterventionIndicator) ? jsonObject['points'].manualInterventionIndicator : Math.floor(jsonObject['points'].manualInterventionIndicator);
}());
}
else
{
pointsObject.manualInterventionIndicator = null;
}
if(typeof jsonObject['points'] === 'object' && 'sirenControl' in jsonObject['points'])
{
pointsObject.sirenControl = (function(){
if(jsonObject['points'].sirenControl === null)
{
return null;
}
if(typeof jsonObject['points'].sirenControl !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].sirenControl)) ? Number(jsonObject['points'].sirenControl) : Math.floor(Number(jsonObject['points'].sirenControl));
}
return Number.isInteger(jsonObject['points'].sirenControl) ? jsonObject['points'].sirenControl : Math.floor(jsonObject['points'].sirenControl);
}());
}
else
{
pointsObject.sirenControl = null;
}
if(typeof jsonObject['points'] === 'object' && 'scaleTareRequest' in jsonObject['points'])
{
pointsObject.scaleTareRequest = (function(){
if(jsonObject['points'].scaleTareRequest === null)
{
return null;
}
if(typeof jsonObject['points'].scaleTareRequest !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].scaleTareRequest)) ? Number(jsonObject['points'].scaleTareRequest) : Math.floor(Number(jsonObject['points'].scaleTareRequest));
}
return Number.isInteger(jsonObject['points'].scaleTareRequest) ? jsonObject['points'].scaleTareRequest : Math.floor(jsonObject['points'].scaleTareRequest);
}());
}
else
{
pointsObject.scaleTareRequest = null;
}
if(typeof jsonObject['points'] === 'object' && 'scaleClearTareRequest' in jsonObject['points'])
{
pointsObject.scaleClearTareRequest = (function(){
if(jsonObject['points'].scaleClearTareRequest === null)
{
return null;
}
if(typeof jsonObject['points'].scaleClearTareRequest !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].scaleClearTareRequest)) ? Number(jsonObject['points'].scaleClearTareRequest) : Math.floor(Number(jsonObject['points'].scaleClearTareRequest));
}
return Number.isInteger(jsonObject['points'].scaleClearTareRequest) ? jsonObject['points'].scaleClearTareRequest : Math.floor(jsonObject['points'].scaleClearTareRequest);
}());
}
else
{
pointsObject.scaleClearTareRequest = null;
}
if(typeof jsonObject['points'] === 'object' && 'scaleZeroRequest' in jsonObject['points'])
{
pointsObject.scaleZeroRequest = (function(){
if(jsonObject['points'].scaleZeroRequest === null)
{
return null;
}
if(typeof jsonObject['points'].scaleZeroRequest !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].scaleZeroRequest)) ? Number(jsonObject['points'].scaleZeroRequest) : Math.floor(Number(jsonObject['points'].scaleZeroRequest));
}
return Number.isInteger(jsonObject['points'].scaleZeroRequest) ? jsonObject['points'].scaleZeroRequest : Math.floor(jsonObject['points'].scaleZeroRequest);
}());
}
else
{
pointsObject.scaleZeroRequest = null;
}
if(typeof jsonObject['points'] === 'object' && 'scaleStableStatus' in jsonObject['points'])
{
pointsObject.scaleStableStatus = (function(){
if(typeof jsonObject['points'].scaleStableStatus !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].scaleStableStatus)) ? Number(jsonObject['points'].scaleStableStatus) : Math.floor(Number(jsonObject['points'].scaleStableStatus));
}
return Number.isInteger(jsonObject['points'].scaleStableStatus) ? jsonObject['points'].scaleStableStatus : Math.floor(jsonObject['points'].scaleStableStatus);
}());
}
else
{
pointsObject.scaleStableStatus = 0;
}
if(typeof jsonObject['points'] === 'object' && 'scaleWeight' in jsonObject['points'])
{
pointsObject.scaleWeight = (function(){
if(jsonObject['points'].scaleWeight === null)
{
return null;
}
if(typeof jsonObject['points'].scaleWeight !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].scaleWeight)) ? Number(jsonObject['points'].scaleWeight) : Math.floor(Number(jsonObject['points'].scaleWeight));
}
return Number.isInteger(jsonObject['points'].scaleWeight) ? jsonObject['points'].scaleWeight : Math.floor(jsonObject['points'].scaleWeight);
}());
}
else
{
pointsObject.scaleWeight = null;
}
if(typeof jsonObject['points'] === 'object' && 'scaleNetWeight' in jsonObject['points'])
{
pointsObject.scaleNetWeight = (function(){
if(jsonObject['points'].scaleNetWeight === null)
{
return null;
}
if(typeof jsonObject['points'].scaleNetWeight !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].scaleNetWeight)) ? Number(jsonObject['points'].scaleNetWeight) : Math.floor(Number(jsonObject['points'].scaleNetWeight));
}
return Number.isInteger(jsonObject['points'].scaleNetWeight) ? jsonObject['points'].scaleNetWeight : Math.floor(jsonObject['points'].scaleNetWeight);
}());
}
else
{
pointsObject.scaleNetWeight = null;
}
if(typeof jsonObject['points'] === 'object' && 'scaleGrossWeight' in jsonObject['points'])
{
pointsObject.scaleGrossWeight = (function(){
if(jsonObject['points'].scaleGrossWeight === null)
{
return null;
}
if(typeof jsonObject['points'].scaleGrossWeight !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].scaleGrossWeight)) ? Number(jsonObject['points'].scaleGrossWeight) : Math.floor(Number(jsonObject['points'].scaleGrossWeight));
}
return Number.isInteger(jsonObject['points'].scaleGrossWeight) ? jsonObject['points'].scaleGrossWeight : Math.floor(jsonObject['points'].scaleGrossWeight);
}());
}
else
{
pointsObject.scaleGrossWeight = null;
}
if(typeof jsonObject['points'] === 'object' && 'scaleTareWeight' in jsonObject['points'])
{
pointsObject.scaleTareWeight = (function(){
if(jsonObject['points'].scaleTareWeight === null)
{
return null;
}
if(typeof jsonObject['points'].scaleTareWeight !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].scaleTareWeight)) ? Number(jsonObject['points'].scaleTareWeight) : Math.floor(Number(jsonObject['points'].scaleTareWeight));
}
return Number.isInteger(jsonObject['points'].scaleTareWeight) ? jsonObject['points'].scaleTareWeight : Math.floor(jsonObject['points'].scaleTareWeight);
}());
}
else
{
pointsObject.scaleTareWeight = null;
}
if(typeof jsonObject['points'] === 'object' && 'targetGrossWeight' in jsonObject['points'])
{
pointsObject.targetGrossWeight = (function(){
if(jsonObject['points'].targetGrossWeight === null)
{
return null;
}
if(typeof jsonObject['points'].targetGrossWeight !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].targetGrossWeight)) ? Number(jsonObject['points'].targetGrossWeight) : Math.floor(Number(jsonObject['points'].targetGrossWeight));
}
return Number.isInteger(jsonObject['points'].targetGrossWeight) ? jsonObject['points'].targetGrossWeight : Math.floor(jsonObject['points'].targetGrossWeight);
}());
}
else
{
pointsObject.targetGrossWeight = null;
}
if(typeof jsonObject['points'] === 'object' && 'currentLiveWeight' in jsonObject['points'])
{
pointsObject.currentLiveWeight = (function(){
if(jsonObject['points'].currentLiveWeight === null)
{
return null;
}
if(typeof jsonObject['points'].currentLiveWeight !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].currentLiveWeight)) ? Number(jsonObject['points'].currentLiveWeight) : Math.floor(Number(jsonObject['points'].currentLiveWeight));
}
return Number.isInteger(jsonObject['points'].currentLiveWeight) ? jsonObject['points'].currentLiveWeight : Math.floor(jsonObject['points'].currentLiveWeight);
}());
}
else
{
pointsObject.currentLiveWeight = null;
}
if(typeof jsonObject['points'] === 'object' && 'startLiveWeighingRequest' in jsonObject['points'])
{
pointsObject.startLiveWeighingRequest = (function(){
if(jsonObject['points'].startLiveWeighingRequest === null)
{
return null;
}
if(typeof jsonObject['points'].startLiveWeighingRequest !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].startLiveWeighingRequest)) ? Number(jsonObject['points'].startLiveWeighingRequest) : Math.floor(Number(jsonObject['points'].startLiveWeighingRequest));
}
return Number.isInteger(jsonObject['points'].startLiveWeighingRequest) ? jsonObject['points'].startLiveWeighingRequest : Math.floor(jsonObject['points'].startLiveWeighingRequest);
}());
}
else
{
pointsObject.startLiveWeighingRequest = null;
}
if(typeof jsonObject['points'] === 'object' && 'finishLiveWeighingRequest' in jsonObject['points'])
{
pointsObject.finishLiveWeighingRequest = (function(){
if(jsonObject['points'].finishLiveWeighingRequest === null)
{
return null;
}
if(typeof jsonObject['points'].finishLiveWeighingRequest !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].finishLiveWeighingRequest)) ? Number(jsonObject['points'].finishLiveWeighingRequest) : Math.floor(Number(jsonObject['points'].finishLiveWeighingRequest));
}
return Number.isInteger(jsonObject['points'].finishLiveWeighingRequest) ? jsonObject['points'].finishLiveWeighingRequest : Math.floor(jsonObject['points'].finishLiveWeighingRequest);
}());
}
else
{
pointsObject.finishLiveWeighingRequest = null;
}
if(typeof jsonObject['points'] === 'object' && 'fruitDeliveryActive' in jsonObject['points'])
{
pointsObject.fruitDeliveryActive = (function(){
if(jsonObject['points'].fruitDeliveryActive === null)
{
return null;
}
if(typeof jsonObject['points'].fruitDeliveryActive !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].fruitDeliveryActive)) ? Number(jsonObject['points'].fruitDeliveryActive) : Math.floor(Number(jsonObject['points'].fruitDeliveryActive));
}
return Number.isInteger(jsonObject['points'].fruitDeliveryActive) ? jsonObject['points'].fruitDeliveryActive : Math.floor(jsonObject['points'].fruitDeliveryActive);
}());
}
else
{
pointsObject.fruitDeliveryActive = null;
}
if(typeof jsonObject['points'] === 'object' && 'status' in jsonObject['points'])
{
pointsObject.status = (function(){
if(typeof jsonObject['points'].status !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].status)) ? Number(jsonObject['points'].status) : Math.floor(Number(jsonObject['points'].status));
}
return Number.isInteger(jsonObject['points'].status) ? jsonObject['points'].status : Math.floor(jsonObject['points'].status);
}());
}
else
{
pointsObject.status = 0;
}
if(typeof jsonObject['points'] === 'object' && 'currentPackrunId' in jsonObject['points'])
{
pointsObject.currentPackrunId = (function(){
if(typeof jsonObject['points'].currentPackrunId !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].currentPackrunId)) ? Number(jsonObject['points'].currentPackrunId) : Math.floor(Number(jsonObject['points'].currentPackrunId));
}
return Number.isInteger(jsonObject['points'].currentPackrunId) ? jsonObject['points'].currentPackrunId : Math.floor(jsonObject['points'].currentPackrunId);
}());
}
else
{
pointsObject.currentPackrunId = 0;
}
if(typeof jsonObject['points'] === 'object' && 'nextPackrunId' in jsonObject['points'])
{
pointsObject.nextPackrunId = (function(){
if(typeof jsonObject['points'].nextPackrunId !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].nextPackrunId)) ? Number(jsonObject['points'].nextPackrunId) : Math.floor(Number(jsonObject['points'].nextPackrunId));
}
return Number.isInteger(jsonObject['points'].nextPackrunId) ? jsonObject['points'].nextPackrunId : Math.floor(jsonObject['points'].nextPackrunId);
}());
}
else
{
pointsObject.nextPackrunId = 0;
}
if(typeof jsonObject['points'] === 'object' && 'currentPackrunName' in jsonObject['points'])
{
pointsObject.currentPackrunName = (function(){
if(typeof jsonObject['points'].currentPackrunName !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].currentPackrunName)) ? Number(jsonObject['points'].currentPackrunName) : Math.floor(Number(jsonObject['points'].currentPackrunName));
}
return Number.isInteger(jsonObject['points'].currentPackrunName) ? jsonObject['points'].currentPackrunName : Math.floor(jsonObject['points'].currentPackrunName);
}());
}
else
{
pointsObject.currentPackrunName = 0;
}
if(typeof jsonObject['points'] === 'object' && 'nextPackrunName' in jsonObject['points'])
{
pointsObject.nextPackrunName = (function(){
if(typeof jsonObject['points'].nextPackrunName !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].nextPackrunName)) ? Number(jsonObject['points'].nextPackrunName) : Math.floor(Number(jsonObject['points'].nextPackrunName));
}
return Number.isInteger(jsonObject['points'].nextPackrunName) ? jsonObject['points'].nextPackrunName : Math.floor(jsonObject['points'].nextPackrunName);
}());
}
else
{
pointsObject.nextPackrunName = 0;
}
if(typeof jsonObject['points'] === 'object' && 'incorrectOperationStatus' in jsonObject['points'])
{
pointsObject.incorrectOperationStatus = (function(){
if(jsonObject['points'].incorrectOperationStatus === null)
{
return null;
}
if(typeof jsonObject['points'].incorrectOperationStatus !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].incorrectOperationStatus)) ? Number(jsonObject['points'].incorrectOperationStatus) : Math.floor(Number(jsonObject['points'].incorrectOperationStatus));
}
return Number.isInteger(jsonObject['points'].incorrectOperationStatus) ? jsonObject['points'].incorrectOperationStatus : Math.floor(jsonObject['points'].incorrectOperationStatus);
}());
}
else
{
pointsObject.incorrectOperationStatus = null;
}
if(typeof jsonObject['points'] === 'object' && 'currentPackrunIncorrectOperationsCount' in jsonObject['points'])
{
pointsObject.currentPackrunIncorrectOperationsCount = (function(){
if(jsonObject['points'].currentPackrunIncorrectOperationsCount === null)
{
return null;
}
if(typeof jsonObject['points'].currentPackrunIncorrectOperationsCount !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].currentPackrunIncorrectOperationsCount)) ? Number(jsonObject['points'].currentPackrunIncorrectOperationsCount) : Math.floor(Number(jsonObject['points'].currentPackrunIncorrectOperationsCount));
}
return Number.isInteger(jsonObject['points'].currentPackrunIncorrectOperationsCount) ? jsonObject['points'].currentPackrunIncorrectOperationsCount : Math.floor(jsonObject['points'].currentPackrunIncorrectOperationsCount);
}());
}
else
{
pointsObject.currentPackrunIncorrectOperationsCount = null;
}
if(typeof jsonObject['points'] === 'object' && 'totalIncorrectOperationsCount' in jsonObject['points'])
{
pointsObject.totalIncorrectOperationsCount = (function(){
if(jsonObject['points'].totalIncorrectOperationsCount === null)
{
return null;
}
if(typeof jsonObject['points'].totalIncorrectOperationsCount !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].totalIncorrectOperationsCount)) ? Number(jsonObject['points'].totalIncorrectOperationsCount) : Math.floor(Number(jsonObject['points'].totalIncorrectOperationsCount));
}
return Number.isInteger(jsonObject['points'].totalIncorrectOperationsCount) ? jsonObject['points'].totalIncorrectOperationsCount : Math.floor(jsonObject['points'].totalIncorrectOperationsCount);
}());
}
else
{
pointsObject.totalIncorrectOperationsCount = null;
}
if(typeof jsonObject['points'] === 'object' && 'manualInterventionStatus' in jsonObject['points'])
{
pointsObject.manualInterventionStatus = (function(){
if(jsonObject['points'].manualInterventionStatus === null)
{
return null;
}
if(typeof jsonObject['points'].manualInterventionStatus !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].manualInterventionStatus)) ? Number(jsonObject['points'].manualInterventionStatus) : Math.floor(Number(jsonObject['points'].manualInterventionStatus));
}
return Number.isInteger(jsonObject['points'].manualInterventionStatus) ? jsonObject['points'].manualInterventionStatus : Math.floor(jsonObject['points'].manualInterventionStatus);
}());
}
else
{
pointsObject.manualInterventionStatus = null;
}
if(typeof jsonObject['points'] === 'object' && 'currentPackrunManualInterventionsCount' in jsonObject['points'])
{
pointsObject.currentPackrunManualInterventionsCount = (function(){
if(jsonObject['points'].currentPackrunManualInterventionsCount === null)
{
return null;
}
if(typeof jsonObject['points'].currentPackrunManualInterventionsCount !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].currentPackrunManualInterventionsCount)) ? Number(jsonObject['points'].currentPackrunManualInterventionsCount) : Math.floor(Number(jsonObject['points'].currentPackrunManualInterventionsCount));
}
return Number.isInteger(jsonObject['points'].currentPackrunManualInterventionsCount) ? jsonObject['points'].currentPackrunManualInterventionsCount : Math.floor(jsonObject['points'].currentPackrunManualInterventionsCount);
}());
}
else
{
pointsObject.currentPackrunManualInterventionsCount = null;
}
if(typeof jsonObject['points'] === 'object' && 'totalManualInterventionsCount' in jsonObject['points'])
{
pointsObject.totalManualInterventionsCount = (function(){
if(jsonObject['points'].totalManualInterventionsCount === null)
{
return null;
}
if(typeof jsonObject['points'].totalManualInterventionsCount !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].totalManualInterventionsCount)) ? Number(jsonObject['points'].totalManualInterventionsCount) : Math.floor(Number(jsonObject['points'].totalManualInterventionsCount));
}
return Number.isInteger(jsonObject['points'].totalManualInterventionsCount) ? jsonObject['points'].totalManualInterventionsCount : Math.floor(jsonObject['points'].totalManualInterventionsCount);
}());
}
else
{
pointsObject.totalManualInterventionsCount = null;
}
if(typeof jsonObject['points'] === 'object' && 'currentPackrunBinsWeighedCount' in jsonObject['points'])
{
pointsObject.currentPackrunBinsWeighedCount = (function(){
if(typeof jsonObject['points'].currentPackrunBinsWeighedCount !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].currentPackrunBinsWeighedCount)) ? Number(jsonObject['points'].currentPackrunBinsWeighedCount) : Math.floor(Number(jsonObject['points'].currentPackrunBinsWeighedCount));
}
return Number.isInteger(jsonObject['points'].currentPackrunBinsWeighedCount) ? jsonObject['points'].currentPackrunBinsWeighedCount : Math.floor(jsonObject['points'].currentPackrunBinsWeighedCount);
}());
}
else
{
pointsObject.currentPackrunBinsWeighedCount = 0;
}
if(typeof jsonObject['points'] === 'object' && 'totalBinsWeighedCount' in jsonObject['points'])
{
pointsObject.totalBinsWeighedCount = (function(){
if(typeof jsonObject['points'].totalBinsWeighedCount !== 'number')
{
return Number.isInteger(Number(jsonObject['points'].totalBinsWeighedCount)) ? Number(jsonObject['points'].totalBinsWeighedCount) : Math.floor(Number(jsonObject['points'].totalBinsWeighedCount));
}
return Number.isInteger(jsonObject['points'].totalBinsWeighedCount) ? jsonObject['points'].totalBinsWeighedCount : Math.floor(jsonObject['points'].totalBinsWeighedCount);
}());
}
else
{
pointsObject.totalBinsWeighedCount = 0;
}
return pointsObject;
}());
}
if('packingLineId' in jsonObject)
{
model.packingLineId = (function(){
if(typeof jsonObject['packingLineId'] !== 'string')
{
return String(jsonObject['packingLineId']);
}
return jsonObject['packingLineId'];
}());
}
if('packrunSourceId' in jsonObject)
{
model.packrunSourceId = (function(){
if(jsonObject['packrunSourceId'] === null)
{
return null;
}
if(typeof jsonObject['packrunSourceId'] !== 'string')
{
return String(jsonObject['packrunSourceId']);
}
return jsonObject['packrunSourceId'];
}());
}
if('packrunGroup' in jsonObject)
{
model.packrunGroup = (function(){
if(jsonObject['packrunGroup'] === null)
{
return null;
}
if(typeof jsonObject['packrunGroup'] !== 'number')
{
return Number.isInteger(Number(jsonObject['packrunGroup'])) ? Number(jsonObject['packrunGroup']) : Math.floor(Number(jsonObject['packrunGroup']));
}
return Number.isInteger(jsonObject['packrunGroup']) ? jsonObject['packrunGroup'] : Math.floor(jsonObject['packrunGroup']);
}());
}
if('sources' in jsonObject)
{
model.sources = (function(){
if(Array.isArray(jsonObject['sources']) !== true)
{
return [];
}
return jsonObject['sources'].map((sourcesItem) => {
return (function(){
return sourcesItem;
}());
});
}());
}
if('autoPackrunChange' in jsonObject)
{
model.autoPackrunChange = (function(){
if(jsonObject['autoPackrunChange'] === null)
{
return null;
}
let autoPackrunChangeObject = {};
if(typeof jsonObject['autoPackrunChange'] === 'object' && 'delay' in jsonObject['autoPackrunChange'])
{
autoPackrunChangeObject.delay = (function(){
if(jsonObject['autoPackrunChange'].delay === null)
{
return null;
}
if(typeof jsonObject['autoPackrunChange'].delay !== 'number')
{
return Number.isInteger(Number(jsonObject['autoPackrunChange'].delay)) ? Number(jsonObject['autoPackrunChange'].delay) : Math.floor(Number(jsonObject['autoPackrunChange'].delay));
}
return Number.isInteger(jsonObject['autoPackrunChange'].delay) ? jsonObject['autoPackrunChange'].delay : Math.floor(jsonObject['autoPackrunChange'].delay);
}());
}
else
{
autoPackrunChangeObject.delay = null;
}
return autoPackrunChangeObject;
}());
}
if('supportsLiveWeighing' in jsonObject)
{
model.supportsLiveWeighing = (function(){
if(jsonObject['supportsLiveWeighing'] === null)
{
return null;
}
if(typeof jsonObject['supportsLiveWeighing'] !== 'boolean')
{
return Boolean(jsonObject['supportsLiveWeighing']);
}
return jsonObject['supportsLiveWeighing'];
}());
}
if('autoWeighingStartThreshold' in jsonObject)
{
model.autoWeighingStartThreshold = (function(){
if(jsonObject['autoWeighingStartThreshold'] === null)
{
return null;
}
if(typeof jsonObject['autoWeighingStartThreshold'] !== 'number')
{
return Number(jsonObject['autoWeighingStartThreshold']);
}
return jsonObject['autoWeighingStartThreshold'];
}());
}
if('autoWeighingStartDelay' in jsonObject)
{
model.autoWeighingStartDelay = (function(){
if(jsonObject['autoWeighingStartDelay'] === null)
{
return null;
}
if(typeof jsonObject['autoWeighingStartDelay'] !== 'number')
{
return Number.isInteger(Number(jsonObject['autoWeighingStartDelay'])) ? Number(jsonObject['autoWeighingStartDelay']) : Math.floor(Number(jsonObject['autoWeighingStartDelay']));
}
return Number.isInteger(jsonObject['autoWeighingStartDelay']) ? jsonObject['autoWeighingStartDelay'] : Math.floor(jsonObject['autoWeighingStartDelay']);
}());
}
if('autoWeighingFinishThreshold' in jsonObject)
{
model.autoWeighingFinishThreshold = (function(){
if(jsonObject['autoWeighingFinishThreshold'] === null)
{
return null;
}
if(typeof jsonObject['autoWeighingFinishThreshold'] !== 'number')
{
return Number(jsonObject['autoWeighingFinishThreshold']);
}
return jsonObject['autoWeighingFinishThreshold'];
}());
}
if('autoWeighingFinishDelay' in jsonObject)
{
model.autoWeighingFinishDelay = (function(){
if(jsonObject['autoWeighingFinishDelay'] === null)
{
return null;
}
if(typeof jsonObject['autoWeighingFinishDelay'] !== 'number')
{
return Number.isInteger(Number(jsonObject['autoWeighingFinishDelay'])) ? Number(jsonObject['autoWeighingFinishDelay']) : Math.floor(Number(jsonObject['autoWeighingFinishDelay']));
}
return Number.isInteger(jsonObject['autoWeighingFinishDelay']) ? jsonObject['autoWeighingFinishDelay'] : Math.floor(jsonObject['autoWeighingFinishDelay']);
}());
}
if('autoWeighingFinishAtGrossTarget' in jsonObject)
{
model.autoWeighingFinishAtGrossTarget = (function(){
if(jsonObject['autoWeighingFinishAtGrossTarget'] === null)
{
return null;
}
if(typeof jsonObject['autoWeighingFinishAtGrossTarget'] !== 'boolean')
{
return Boolean(jsonObject['autoWeighingFinishAtGrossTarget']);
}
return jsonObject['autoWeighingFinishAtGrossTarget'];
}());
}
if('manualInterventionMaximumDuration' in jsonObject)
{
model.manualInterventionMaximumDuration = (function(){
if(jsonObject['manualInterventionMaximumDuration'] === null)
{
return null;
}
if(typeof jsonObject['manualInterventionMaximumDuration'] !== 'number')
{
return Number.isInteger(Number(jsonObject['manualInterventionMaximumDuration'])) ? Number(jsonObject['manualInterventionMaximumDuration']) : Math.floor(Number(jsonObject['manualInterventionMaximumDuration']));
}
return Number.isInteger(jsonObject['manualInterventionMaximumDuration']) ? jsonObject['manualInterventionMaximumDuration'] : Math.floor(jsonObject['manualInterventionMaximumDuration']);
}());
}
if('liveWeighingIncreaseTolerance' in jsonObject)
{
model.liveWeighingIncreaseTolerance = (function(){
if(jsonObject['liveWeighingIncreaseTolerance'] === null)
{
return null;
}
if(typeof jsonObject['liveWeighingIncreaseTolerance'] !== 'number')
{
return Number(jsonObject['liveWeighingIncreaseTolerance']);
}
return jsonObject['liveWeighingIncreaseTolerance'];
}());
}
if('liveWeighingDecreaseTolerance' in jsonObject)
{
model.liveWeighingDecreaseTolerance = (function(){
if(jsonObject['liveWeighingDecreaseTolerance'] === null)
{
return null;
}
if(typeof jsonObject['liveWeighingDecreaseTolerance'] !== 'number')
{
return Number(jsonObject['liveWeighingDecreaseTolerance']);
}
return jsonObject['liveWeighingDecreaseTolerance'];
}());
}
if('liveWeighingUpdateInterval' in jsonObject)
{
model.liveWeighingUpdateInterval = (function(){
if(jsonObject['liveWeighingUpdateInterval'] === null)
{
return null;
}
if(typeof jsonObject['liveWeighingUpdateInterval'] !== 'number')
{
return Number.isInteger(Number(jsonObject['liveWeighingUpdateInterval'])) ? Number(jsonObject['liveWeighingUpdateInterval']) : Math.floor(Number(jsonObject['liveWeighingUpdateInterval']));
}
return Number.isInteger(jsonObject['liveWeighingUpdateInterval']) ? jsonObject['liveWeighingUpdateInterval'] : Math.floor(jsonObject['liveWeighingUpdateInterval']);
}());
}
if('liveWeighingUsesStableStatus' in jsonObject)
{
model.liveWeighingUsesStableStatus = (function(){
if(jsonObject['liveWeighingUsesStableStatus'] === null)
{
return null;
}
if(typeof jsonObject['liveWeighingUsesStableStatus'] !== 'boolean')
{
return Boolean(jsonObject['liveWeighingUsesStableStatus']);
}
return jsonObject['liveWeighingUsesStableStatus'];
}());
}
if('incorrectOperationTolerance' in jsonObject)
{
model.incorrectOperationTolerance = (function(){
if(jsonObject['incorrectOperationTolerance'] === null)
{
return null;
}
if(typeof jsonObject['incorrectOperationTolerance'] !== 'number')
{
return Number(jsonObject['incorrectOperationTolerance']);
}
return jsonObject['incorrectOperationTolerance'];
}());
}
if('freshPackIntegration' in jsonObject)
{
model.freshPackIntegration = (function(){
if(jsonObject['freshPackIntegration'] === null)
{
return null;
}
let freshPackIntegrationObject = {};
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'points' in jsonObject['freshPackIntegration'])
{
freshPackIntegrationObject.points = (function(){
if(typeof jsonObject['freshPackIntegration'].points !== 'object')
{
return Object(jsonObject['freshPackIntegration'].points);
}
return jsonObject['freshPackIntegration'].points;
}());
}
else
{
freshPackIntegrationObject.points = {}
}
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'enabled' in jsonObject['freshPackIntegration'])
{
freshPackIntegrationObject.enabled = (function(){
if(typeof jsonObject['freshPackIntegration'].enabled !== 'boolean')
{
return Boolean(jsonObject['freshPackIntegration'].enabled);
}
return jsonObject['freshPackIntegration'].enabled;
}());
}
else
{
freshPackIntegrationObject.enabled = false;
}
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'materialGroupId' in jsonObject['freshPackIntegration'])
{
freshPackIntegrationObject.materialGroupId = (function(){
if(jsonObject['freshPackIntegration'].materialGroupId === null)
{
return null;
}
if(typeof jsonObject['freshPackIntegration'].materialGroupId !== 'number')
{
return Number.isInteger(Number(jsonObject['freshPackIntegration'].materialGroupId)) ? Number(jsonObject['freshPackIntegration'].materialGroupId) : Math.floor(Number(jsonObject['freshPackIntegration'].materialGroupId));
}
return Number.isInteger(jsonObject['freshPackIntegration'].materialGroupId) ? jsonObject['freshPackIntegration'].materialGroupId : Math.floor(jsonObject['freshPackIntegration'].materialGroupId);
}());
}
else
{
freshPackIntegrationObject.materialGroupId = null;
}
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'binTypeId' in jsonObject['freshPackIntegration'])
{
freshPackIntegrationObject.binTypeId = (function(){
if(typeof jsonObject['freshPackIntegration'].binTypeId !== 'number')
{
return Number.isInteger(Number(jsonObject['freshPackIntegration'].binTypeId)) ? Number(jsonObject['freshPackIntegration'].binTypeId) : Math.floor(Number(jsonObject['freshPackIntegration'].binTypeId));
}
return Number.isInteger(jsonObject['freshPackIntegration'].binTypeId) ? jsonObject['freshPackIntegration'].binTypeId : Math.floor(jsonObject['freshPackIntegration'].binTypeId);
}());
}
else
{
freshPackIntegrationObject.binTypeId = 0;
}
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'printerGroupId' in jsonObject['freshPackIntegration'])
{
freshPackIntegrationObject.printerGroupId = (function(){
if(jsonObject['freshPackIntegration'].printerGroupId === null)
{
return null;
}
if(typeof jsonObject['freshPackIntegration'].printerGroupId !== 'number')
{
return Number.isInteger(Number(jsonObject['freshPackIntegration'].printerGroupId)) ? Number(jsonObject['freshPackIntegration'].printerGroupId) : Math.floor(Number(jsonObject['freshPackIntegration'].printerGroupId));
}
return Number.isInteger(jsonObject['freshPackIntegration'].printerGroupId) ? jsonObject['freshPackIntegration'].printerGroupId : Math.floor(jsonObject['freshPackIntegration'].printerGroupId);
}());
}
else
{
freshPackIntegrationObject.printerGroupId = null;
}
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'binCardPrintingEnabled' in jsonObject['freshPackIntegration'])
{
freshPackIntegrationObject.binCardPrintingEnabled = (function(){
if(typeof jsonObject['freshPackIntegration'].binCardPrintingEnabled !== 'boolean')
{
return Boolean(jsonObject['freshPackIntegration'].binCardPrintingEnabled);
}
return jsonObject['freshPackIntegration'].binCardPrintingEnabled;
}());
}
else
{
freshPackIntegrationObject.binCardPrintingEnabled = false;
}
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'useWindowsDriverApi' in jsonObject['freshPackIntegration'])
{
freshPackIntegrationObject.useWindowsDriverApi = (function(){
if(typeof jsonObject['freshPackIntegration'].useWindowsDriverApi !== 'boolean')
{
return Boolean(jsonObject['freshPackIntegration'].useWindowsDriverApi);
}
return jsonObject['freshPackIntegration'].useWindowsDriverApi;
}());
}
else
{
freshPackIntegrationObject.useWindowsDriverApi = false;
}
return freshPackIntegrationObject;
}());
}
if('deleted' in jsonObject)
{
model.deleted = (function(){
if(typeof jsonObject['deleted'] !== 'boolean')
{
return Boolean(jsonObject['deleted']);
}
return jsonObject['deleted'];
}());
}
if('updateTimestamp' in jsonObject)
{
model.updateTimestamp = (function(){
if(typeof jsonObject['updateTimestamp'] !== 'string')
{
return new Date(String(jsonObject['updateTimestamp']));
}
return new Date(jsonObject['updateTimestamp']);
}());
}
return model;
}
}
export default RejectBinScaleModel;
source