using DTS.Common.Base;
using DTS.Common.Enums.Groups;
using DTS.Common.Interface.Channels;
using DTS.Common.Utils;
using System.Windows.Media;
namespace DTS.Common.Interface.Groups
{
///
/// this class describes the view module for the group import module
/// this handles iteraction betweens the views and the application, as well as
/// the logic and intermediate data for the module
///
public interface IGroupImportViewModel : IBaseViewModel
{
void SetStatus(string message, Color color);
///
/// options view controls selecting files
///
IGroupImportOptionsView ImportOptionsView { get; set; }
///
/// preview view handles selecting groups and viewing channels in a .grp file
///
IGroupImportPreviewView ImportPreviewView { get; set; }
///
/// handles commiting and displaying progress as commiting groups
///
IGroupImportImportView ImportView { get; set; }
///
/// reads source files and parses out channels and groups
///
void ParseSourceFiles(string userTags);
///
/// commits groups and channels to application
///
void Import();
///
/// resets the view model to initial values
/// we are currently not creating a new viewmodel in the page, but re-using an existing one
/// so everytime we re-visit the page we must re-initialize the vm
///
void Reset();
///
/// logging facility to log any messages to
///
FileUtils.LogDelegate Logger { get; set; }
///
/// nav steps exist outside the group import module, and inside
/// the application itself
/// this is the function that allows the module to change nav steps
///
SwitchNavStepsDelegate SwitchNavSteps { get; set; }
///
/// this provides a function for checking whether a group already exists in the application or not
///
CheckGroupExistsDelegate CheckGroupExists { get; set; }
///
/// this provides a function for checking whether a sensor already exists in the application or not
///
CheckSensorExistsDelegate CheckSensorExists { get; set; }
///
/// as groups exist in the application space currently, we need the application to actually create a group
/// this is the function that lets the module invoke creating a group
///
CreateGroupDelegate CreateGroup { get; set; }
///
/// as groups exist in the application space currently, we need the application to actually create channels in a group
/// this is the function that lets the module invoke adding a channel to a group
///
AddChannelToGroupDelegate AddChannel { get; set; }
///
/// as groups exist in the application space currently, we need the application to actually commit groups to the database
/// this is the function that lets the module invoke commiting a group to the db
///
CommitGroupsDelegate CommitGroups { get; set; }
///
/// allows the module to disable the UI
///
Disable_UIDelegate DisableUI { get; set; }
///
/// allows the module to enable the UI
///
Enable_UIDelegate EnableUI { get; set; }
bool BrowseOk { get; set; }
}
///
/// delegate describing a method of switching navigation steps
///
/// step to switch to
public delegate void SwitchNavStepsDelegate(GroupImportEnums.Steps step);
///
/// delegate describing a method of checking if a group exists
///
/// group serial number/name to check for
///
public delegate bool CheckGroupExistsDelegate(string name);
///
/// delegate describing a method of checking if a sensor exists
///
/// serial number of sensor to check for
///
public delegate bool CheckSensorExistsDelegate(string serialNumber);
///
/// delegate describing a method for creating a group
///
/// serial number of new group
/// tags that will be added to new group
public delegate void CreateGroupDelegate(string serialNumber, string tags);
///
/// adds a channel to a group
/// channels are added to the end of the groups existing channels
///
/// group serial number/name to add channel to
/// the display name of the channel
/// the sensor serial number of the sensor on the channel
/// null if the sensor capacity should be used, otherwise the desired range for the channel
/// null if the sensor invert setting should be used, otherwise the desired invert settings for the channel
public delegate void AddChannelToGroupDelegate(string groupSerialNumber, string displayName,
string sensorSerialNumber, double? capacity, bool? invert, string isoCode, IChannelSetting[] channelDefaults);
///
/// delegate describing a method for commiting a group to the database
///
///
public delegate void CommitGroupsDelegate(string[] serialNumbers);
public delegate void Disable_UIDelegate();
public delegate void Enable_UIDelegate();
}