You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

252 lines
7.9 KiB

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
{
/// <summary>
/// 公共参数
/// </summary>
public static ComParameters Parameters
{
get
{
if (_par == null)
_par = new ComParameters();
return _par;
}
}
private static ComParameters _par;
private ComParameters()
{
machineTypeDic = new Dictionary<string, string>()
{
{"1","导视"},{"2","信发"},{"3","游戏"},
};
machineAttrDic = new Dictionary<string, string>()
{
{"0","触摸"},{"1","非触摸"},
};
}
#region 静态配置字段
//cqmyg#hdhxt!saas
internal string SecurityKey { get { return "==wchF2chQHeoRGajcWetF3Y"; } }
/// <summary>
/// 初次使用
/// </summary>
internal string PreSetContainerVersion = "V1.0";
internal string PreSetWebVersion = "V1.0";
/// <summary>
/// 读写锁
/// </summary>
internal static ReaderWriterLockSlim rwl = new ReaderWriterLockSlim();
internal static ReaderWriterLockSlim srwl = new ReaderWriterLockSlim();
internal Dictionary<string, string> machineTypeDic;
internal Dictionary<string, string> machineAttrDic;
/// <summary>
/// 当没有素材时等待多久
/// </summary>
internal int waitMilliseconds = 60000;
/// <summary>
/// 字幕速度
/// </summary>
internal int subtitleSpeed = 150;
/// <summary>
/// 悬浮图标移动速度
/// </summary>
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; }
/// <summary>
/// 商场激活码
/// </summary>
public string registerCode { get; set; }
/// <summary>
/// 项目码
/// </summary>
public string projectCode { get; set; }
/// <summary>
/// 项目名
/// </summary>
public string projectName { get; set; }
/// <summary>
/// 楼栋
/// </summary>
public string buildingName { get; set; }
/// <summary>
/// 楼层
/// </summary>
public string floorName { get; set; }
/// <summary>
/// 设备码
/// </summary>
public string devCode { get; set; }
/// <summary>
/// 设备名
/// </summary>
public string devName { get; set; }
/// <summary>
/// 类型(1导视 2信发 3会议室)
/// </summary>
public string devType { get; set; }
/// <summary>
/// 触摸(0-触摸 1-非触摸)
/// </summary>
public string devAttr { get; set; }
/// <summary>
/// 标签 windows或android
/// </summary>
public string label { get; set; }
/// <summary>
/// 分辨率
/// </summary>
public string resolution { get; set; }
/// <summary>
/// ip
/// </summary>
public string ip { get; set; }
/// <summary>
/// mac地址
/// </summary>
public string mac { get; set; }
/// <summary>
/// mqtt地址
/// </summary>
public string mqttServer { get; set; }
/// <summary>
/// mqtt端口
/// </summary>
public int mqttPort { get; set; }
/// <summary>
/// 密码
/// </summary>
public string pwd { get; set; }
/// <summary>
/// 文件服务器地址
/// </summary>
public string downloadUrl { get; set; }
/// <summary>
/// 设备组codes
/// </summary>
public string devGroupCodes { get; set; }
private int _ntSeconds;
/// <summary>
/// 多久未操作开启信发的设置(s)
/// </summary>
public int noTouchingSeconds
{
get { return _ntSeconds; }
set
{
_ntSeconds = value;
//1秒误差
totalNoTouchSeconds = (value + 1+ jumpTime) * 1000;
}
}
/// <summary>
/// 应用跳回首页时间
/// </summary>
public int jumpTime { get; set; }
/// <summary>
/// 导视屏保的样式图标 类型 0:无提示图标,1:样式一,2:样式二,3:样式三,4:样式四
/// </summary>
public string labelType { get; set; }
/// <summary>
/// 导视屏保的样式图标 动画效果 0:固定位置,1:自由运动
/// </summary>
public string labelEffect { get; set; }
/// <summary>
/// 导视屏保的样式图标 位置 0:右下角显示,1:居中显示,2:左右移动,3:随机移动
/// </summary>
public string labelLocation { get; set; }
/// <summary>
/// 屏保壁纸
/// </summary>
public string screenSaver { get; set; }
/// <summary>
/// 屏保壁纸哈希值
/// </summary>
public string screenSaverHash { get; set; }
/// <summary>
/// 屏保Touch
/// </summary>
public string screenSaverTouch { get; set; }
/// <summary>
/// 屏保Touch哈希值
/// </summary>
public string screenSaverTouchHash { get; set; }
/// <summary>
/// 容器版本
/// </summary>
public string containerVersion { get; set; }
/// <summary>
/// 应用版本
/// </summary>
public string webVersion { get; set; }
/// <summary>
/// 讯飞语音代理IP
/// </summary>
public string xfyunIp { get; set; }
/// <summary>
/// 讯飞语音代理端口
/// </summary>
public string xfyunPort { get; set; }
/// <summary>
/// 百度语音代理服务
/// </summary>
public string baiduVoiceServer { get; set; }
#endregion
}
}