#region --------------- Copyright Dresser Wayne Pignone -------------
/*
* $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/IForecourtControl.cs $
*
* 5 07-10-18 17:12 roger.månsson
* Added IForecourtControl.OnFuelPriceChange event.
*
* 4 07-03-08 13:08 roger.månsson
* Added PricePoles
*
* 3 07-01-12 15:25 roger.månsson
* Made IDisposable
*
* 2 07-01-05 15:10 roger.månsson
* Added TankGroups property
*/
#endregion
using System;
using System.Collections.Generic;
namespace Wayne.ForecourtControl
{
///
/// The ForecourtControl object is the main root object to the Forecourtcontrol object hiearchy. It owns a list of pumps, and provides
/// functionality to control the site.
///
public interface IForecourtControl : Wayne.Lib.IConnectable,
Wayne.Lib.IIdentifiableEntity,
IDisposable
{
#region Properties
///
/// ClientId in the communicationClientName in the communication to the Forecourt Controller.
///
int ClientId { get;}
///
/// ClientName in the communication to the Forecourt Controller.
///
string ClientName { get;}
///
/// Tells whether the site is open or closed.
///
bool SiteOpened { get;}
///
/// This property tells the operation mode of the site according to the pre-configured pump operation. Typically the configuration has been pre-defined with
/// day, Night and rush hour operation modes, but this interface does not restrict which site mode that is used as day, night and rush-hour.
///
int SiteMode { get;}
///
/// The collection of pump objects.
///
System.Collections.ObjectModel.ReadOnlyCollection Pumps {get;}
///
/// The collection of Fuel prices.
///
System.Collections.ObjectModel.ReadOnlyCollection FuelPrices { get;}
///
/// The collection of Tank groups.
///
System.Collections.ObjectModel.ReadOnlyCollection TankGroups { get;}
///
/// The collection of Price poles.
///
System.Collections.ObjectModel.ReadOnlyCollection PricePoles { get;}
///
/// The collection of Price poles.
///
System.Collections.ObjectModel.ReadOnlyCollection FuelProducts { get; }
///
/// The collection of Fuel price reading from pump control.
///
System.Collections.ObjectModel.ReadOnlyCollection FuelPriceReadings { get; }
#endregion
#region Methods
///
/// Opens or closes the station.
///
/// True if the station should be opened, and false if it should be closed.
/// Delegate that will be called on completion.
/// A user supplied object that will be returned in the requestCompleted callback
void SetSiteOpenedAsync(bool opened, EventHandler requestCompleted, object userToken);
///
/// Sets the site mode. The pumps can be set in different modes for different site modes. This
/// enables the option to have different day/night/rush modes of the station.
///
/// The new site mode.
/// Delegate that will becalled on completion.
/// A user supplied object that will be returned in the requestCompleted callback
void SetSiteModeAsync(int siteMode, EventHandler requestCompleted,object userToken);
///
/// Reserves the fuel prices so they can be changed by this client.
///
/// Callback delegate that will becalled on completion
/// A user supplied object that will be returned in the requestCompleted callback
void ReserveFuelPricesAsync(EventHandler requestCompleted, object userToken);
///
/// Releases the fuel price reservation. If the fuel prices were no reserved, the function will still return success=true.
/// Changes made to the fuel prices will be undone.
///
/// Callback delegate that will becalled on completion
/// A user supplied object that will be returned in the requestCompleted callback
void UnreserveFuelPricesAsync(EventHandler requestCompleted, object userToken);
///
/// Activates the fuel prices, and triggers a new Fuel period when the prices has been activated.
/// Note that it can take several minutes before all price signs and pumps have been updated.
/// The FuelPrice reservation is released, so UnreserveFuelPricesAsync must not be called afterwards.
///
/// Callback delegate that will becalled on completion
/// A user supplied object that will be returned in the requestCompleted callback
void ActivateFuelPricesAsync(EventHandler requestCompleted, object userToken);
///
/// Get Fuel prices.
///
/// Delegate that will be called on completion.
/// A user supplied object that will be returned in the requestCompleted callback
void GetFuelPricesAsync(EventHandler>> requestCompleted, object userToken);
///
/// Set Fuel prices.
///
/// Price set information.
/// Delegate that will be called on completion.
/// A user supplied object that will be returned in the requestCompleted callback
void SetFuelPriceAsync(IList newFuelPrices, EventHandler requestCompleted, object userToken);
///
/// Reserves the pump cluster for the specified terminal number. The terminal device id is 1-based.
///
///
///
///
void ReservePumpClusterAsync(int terminalDeviceId, EventHandler requestCompleted, object userToken);
///
/// Unreserves the pump cluster for the specified terminal number. The terminal device id is 1-based.
///
///
///
///
void UnreservePumpClusterAsync(int terminalDeviceId, EventHandler requestCompleted, object userToken);
///
/// Initiates a close reconciliation period at Fusion
///
///
///
void CloseReconciliationPeriodAsync(EventHandler requestCompleted, object userToken);
///
/// Get Tank reconciliation
///
/// device ID
/// Delegate that will be called on completion.
/// A user supplied object that will be returned in the requestCompleted callback
void GetTankReconciliationAsync(int deviceId, EventHandler> requestCompleted, object userToken);
///
/// Get Tank delivery
///
/// device ID
/// Delegate that will be called on completion.
/// A user supplied object that will be returned in the requestCompleted callback
void GetTankDeliveryAsync(int deviceId, EventHandler> requestCompleted, object userToken);
#endregion
#region Events
///
/// Event Fired when the site mode, i.e. the Site mode or the Site open/close mode has changed.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "OnSite")]
event EventHandler OnSiteModeChange;
///
/// Configuration changed.
///
event EventHandler OnConfigurationChange;
///
/// Event that is raised when an alarm is fired from forecourt controller.
///
event EventHandler OnAlarm;
///
/// Event fired when the fuel prices has been changed on the station and a new fuel price shift has been
/// created.
///
event EventHandler OnFuelPriceChange;
#endregion
///
/// Fires an DeviceAlarm request to ifsf server.
///
///
///
///
///
///
void SendDeviceAlarmAsync(int deviceId, string deviceType, IEnumerable alarmIds, IEnumerable messages,
EventHandler requestCompleted, object userToken);
}
}