Пример #1
0
 public UposEventArguments(IUposProperties properties)
 {
     Properties                 = properties;
     DataEventHandler           = EmptyData;
     ErrorEventHandler          = EmptyError;
     StatusUpdateEventHandler   = EmptyStatus;
     OutputCompleteEventHandler = EmptyOutput;
     DirectIOEventHandler       = EmptyDirectIO;
 }
Пример #2
0
        public int OpenService(string deviceClass, string deviceName, object dispatchObject)
        {
            Log.DebugFormat("OpeningService for deviceClass {0} called {1}", deviceClass, deviceName);
            OpenServiceDeviceClass = deviceClass;
            OpenServiceDeviceName  = deviceName;

            if (_props == null)
            {
                _props = GetDeviceSpecifcUposProperties();
            }

            Log.Debug("Creating EventDispatcher");
            _eventQueue = new EventThreadHelper(GetDeviceSpecificControlObjectDispatcher(dispatchObject), _props);

            Log.Debug("Getting configuration options from Registry");
            var registryValues = WindowsUposRegistry.GetRegistryValues(OpenServiceDeviceClass, OpenServiceDeviceName);

            if (VerifyDeviceSettings(registryValues))
            {
                _device     = GetDevice();
                _openResult = _device.CanCommunicateWithDevice(deviceClass, deviceName, registryValues);
                if (_openResult == OpenResultConstants.OPOS_SUCCESS)
                {
                    Log.Debug("Communication with device succeeded, Opening service is successful");
                    _props.ByName.Claimed              = false;
                    _props.ByName.DeviceEnabled        = false;
                    _props.ByName.DataEventEnabled     = false;
                    _props.ByName.FreezeEvents         = false;
                    _props.ByName.State                = ServiceStateConstants.OPOS_S_IDLE;
                    _props.ByName.DeviceDescription    = GetDeviceDescription();
                    _props.ByName.ServiceObjectVersion = GetImplementingVersion();
                    return(SetResultCode(ResultCodeConstants.Success));
                }
                Log.Error("Device Specific check for communicating with device failed. Check configuration values to verify proper values are set to be able to communicate with device");

                return(SetResultCode(ResultCodeConstants.NoHardware));
            }
            Log.Error("Device Specific validation of configuration options failed. Please verify that all settings are correct and in proper location in Windows registry");
            _openResult = OpenResultConstants.OPOS_ORS_CONFIG;

            return(SetResultCode(ResultCodeConstants.Failure));
        }
 public NamedCashDrawerProperties(IUposProperties baseProperties)
 {
     _baseProperties      = baseProperties;
     _baseNamedProperties = baseProperties.ByName;
 }
 public EventThreadHelper(COPOS oposDevice, IUposProperties uposProperties)
 {
     _oposDevice     = oposDevice;
     _uposProperties = uposProperties;
     _uposProperties.PropertyChanged += oposDevice_PropertyChanged;
 }
Пример #5
0
 public NamedUposBaseProperties(UposBaseProperties uposBaseProperties)
 {
     _uposBaseProperties = uposBaseProperties;
 }
Пример #6
0
 public CashDrawerDeviceEnabledPropertyValidator(IUposProperties properties, ICashDrawerDevice device)
 {
     _properties = properties;
     _device     = device;
 }
 public DeviceClaimedBooleanValidator(IUposProperties properties)
 {
     _properties = properties;
 }
 public void Setup()
 {
     _props = new TestableUposBaseProperties();
     _props.AddProperty("FakePropertyInt", FakeIntPropertyIndex, FakeIntPropertyValue);
     _props.AddProperty("FakePropertyString", FakeStringPropertyIndex, FakeStringPropertyValue);
 }