using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GeneralLib;
namespace SunVoteARSPPT
{
public class ARSText : IResponse
{
///
/// 数字评分类
///
public SunVote.Cloze Text = null;
///
/// 构造函数
///
public ARSText()
{
Text = new SunVote.Cloze();
Text.KeyStatus += new SunVote.IClozeEvents_KeyStatusEventHandler(Text_KeyStatus);
Text.KeyStatusSN += new SunVote.IClozeEvents_KeyStatusSNEventHandler(Text_KeyStatusSN);
//PVS事件。杨斌 2015-03-17
FrmPvsServer.GetFrmPvs().OnKeyVote += myPVS_KeyVote;
TagSet = new TagSet();
}
void myPVS_KeyVote(int ID, int iMode, string sInfo)
{
string KeyValue = ConvertOper.DoNumberString(sInfo);
ResponsePar ObjResponseValue = new ResponsePar();
//ObjResponseValue.BaseTag = BaseTag;
ObjResponseValue.KeyID = ID.ToString();
ObjResponseValue.KeyValue = KeyValue;
ObjResponseValue.Speed = 0;
if (ResponseEventHander != null)
ResponseEventHander(ObjResponseValue);
}
void Text_KeyStatusSN(string BaseTag, string KeySN, string KeyValue, double KeyTime)
{
KeyValue = ConvertOper.DoNumberString(KeyValue);//杨斌 2013-08-29
ResponsePar ObjResponseValue = new ResponsePar();
ObjResponseValue.BaseTag = BaseTag;
ObjResponseValue.KeyID = KeySN;
ObjResponseValue.KeyValue = KeyValue;
ObjResponseValue.Speed = KeyTime;
ResponseEventHander(ObjResponseValue);
}
///
/// 键盘状态
///
///
///
///
///
void Text_KeyStatus(string BaseTag, int KeyID, string KeyValue, double KeyTime)
{
Text_KeyStatusSN(BaseTag, KeyID.ToString(), KeyValue, KeyTime);
}
#region IResponse 成员
public event ResponseEventHander ResponseEventHander;
///
/// 修改:杨斌 2012-06-27
///
public void Start()
{
if (GlobalInfo.GetSdkType() == 0)
{
Text.BaseConnection = BaseConnection;
//修改模式 0:不允许修改,1:允许修改
Text.ModifyMode = (TagSet.GetValue(TagKey.KeypadPara_ModifyMode).ToInt == 0 ? 1 : 0);
//保密模式
Text.SecrecyMode = 0;
//填空类型
Text.ClozeType = 0;
//长度
Text.MaxLength = 16;
//答案提示模式
Text.PromptMode = 0;
//正确答案
Text.CorrectAnswer = "";
//启动模式
Text.StartMode = 1;
Text.Start();
}
else if (GlobalInfo.GetSdkType() == 1)
{
}
}
public void Stop()
{
if (GlobalInfo.GetSdkType() == 0)
{
Text.Stop();
}
else if (GlobalInfo.GetSdkType() == 1)
{
//FrmPvsServer.GetFrmPvs().VoteStop();
}
}
///
/// 基站连接类
///
public SunVote.BaseConnection BaseConnection { get; set; }
///
/// 幻灯片Tag值
///
public TagSet TagSet { get; set; }
///
/// 反馈类型
///
public ResponseType ResponseType { get; set; }
#endregion
}
}