using IOTContainer.Communication;
using IOTContainer.Model;
using IOTContainer.View;
using IOTContainer.ViewModel;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace IOTContainer.Common
{
public class ComParameters
{
///
/// 公共参数
///
public static ComParameters Parameters
{
get
{
if (_par == null)
_par = new ComParameters();
return _par;
}
}
private static ComParameters _par;
private ComParameters()
{
machineTypeDic = new Dictionary()
{
{"1","导视"},{"2","信发"},{"3","游戏"},
};
machineAttrDic = new Dictionary()
{
{"0","触摸"},{"1","非触摸"},
};
}
#region 静态配置字段
//cqmyg#hdhxt!saas
internal string SecurityKey { get { return "==wchF2chQHeoRGajcWetF3Y"; } }
///
/// 初次使用
///
internal string PreSetContainerVersion = "V1.0";
internal string PreSetWebVersion = "V1.0";
///
/// 读写锁
///
internal static ReaderWriterLockSlim rwl = new ReaderWriterLockSlim();
internal static ReaderWriterLockSlim srwl = new ReaderWriterLockSlim();
internal Dictionary machineTypeDic;
internal Dictionary machineAttrDic;
///
/// 当没有素材时等待多久
///
internal int waitMilliseconds = 60000;
///
/// 字幕速度
///
internal int subtitleSpeed = 150;
///
/// 悬浮图标移动速度
///
internal int rectBtnSpeed = 100;
#endregion
#region 全局变量
internal long totalNoTouchSeconds;
internal bool WebSocketIsConnected;
internal string MainMachineIp;
internal int? ProgramIndex;
internal int? CurrentProgramIndex;
internal int? CurrentMaterialIndex;
internal int? RecordMaterialIndex;
internal int? RecordProgramIndex;
internal bool isMaterialIndex;
internal string SocketPort;
internal string CmdChrome;
internal double TopTotalWidth;
internal double BottomTotalWidth;
internal bool IsMainMachine = false;
internal bool IsSync = false;
internal bool IsPlay = false;
internal bool ProListIsEmpty;
internal bool SubListIsEmpty;
internal MqttClientCom MqttClient;
internal CancellationTokenSource PlayToken;
internal CancellationTokenSource PlaySubtitleToken;
//view
internal ScreenWindowNew ScreenWindowNew;
internal ScreenWindow ScreenWindow;
internal TouchMe TouchMe;
internal EdgeWindow EdgeWindow;
internal MainWindow MainWindow;
internal MessBoxWindow MessBoxWindow;
//viewmodel
internal MainWindowViewModel MainViewModel;
internal ScreenWindowViewModel ScreenViewModel;
internal MessBoxViewModel MessBoxViewModel;
internal InitialViewModel MessageViewModel;
internal VersionInfoViewModel VersionInfoViewModel;
#endregion
#region 动态配置字段
public string httpServer { get; set; }
public string httpPort { get; set; }
///
/// 商场激活码
///
public string registerCode { get; set; }
///
/// 项目码
///
public string projectCode { get; set; }
///
/// 项目名
///
public string projectName { get; set; }
///
/// 楼栋
///
public string buildingName { get; set; }
///
/// 楼层
///
public string floorName { get; set; }
///
/// 设备码
///
public string devCode { get; set; }
///
/// 设备名
///
public string devName { get; set; }
///
/// 类型(1导视 2信发 3会议室)
///
public string devType { get; set; }
///
/// 触摸(0-触摸 1-非触摸)
///
public string devAttr { get; set; }
///
/// 标签 windows或android
///
public string label { get; set; }
///
/// 分辨率
///
public string resolution { get; set; }
///
/// ip
///
public string ip { get; set; }
///
/// mac地址
///
public string mac { get; set; }
///
/// mqtt地址
///
public string mqttServer { get; set; }
///
/// mqtt端口
///
public int mqttPort { get; set; }
///
/// 密码
///
public string pwd { get; set; }
///
/// 文件服务器地址
///
public string downloadUrl { get; set; }
///
/// 设备组codes
///
public string devGroupCodes { get; set; }
private int _ntSeconds;
///
/// 多久未操作开启信发的设置(s)
///
public int noTouchingSeconds
{
get { return _ntSeconds; }
set
{
_ntSeconds = value;
//1秒误差
totalNoTouchSeconds = (value + 1+ jumpTime) * 1000;
}
}
///
/// 应用跳回首页时间
///
public int jumpTime { get; set; }
///
/// 导视屏保的样式图标 类型 0:无提示图标,1:样式一,2:样式二,3:样式三,4:样式四
///
public string labelType { get; set; }
///
/// 导视屏保的样式图标 动画效果 0:固定位置,1:自由运动
///
public string labelEffect { get; set; }
///
/// 导视屏保的样式图标 位置 0:右下角显示,1:居中显示,2:左右移动,3:随机移动
///
public string labelLocation { get; set; }
///
/// 屏保壁纸
///
public string screenSaver { get; set; }
///
/// 屏保壁纸哈希值
///
public string screenSaverHash { get; set; }
///
/// 屏保Touch
///
public string screenSaverTouch { get; set; }
///
/// 屏保Touch哈希值
///
public string screenSaverTouchHash { get; set; }
///
/// 容器版本
///
public string containerVersion { get; set; }
///
/// 应用版本
///
public string webVersion { get; set; }
///
/// 讯飞语音代理IP
///
public string xfyunIp { get; set; }
///
/// 讯飞语音代理端口
///
public string xfyunPort { get; set; }
///
/// 百度语音代理服务
///
public string baiduVoiceServer { get; set; }
#endregion
}
}