ARSText.cs
3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GeneralLib;
namespace SunVoteARSPPT
{
public class ARSText : IResponse
{
/// <summary>
/// 数字评分类
/// </summary>
public SunVote.Cloze Text = null;
/// <summary>
/// 构造函数
/// </summary>
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);
}
/// <summary>
/// 键盘状态
/// </summary>
/// <param name="BaseTag"></param>
/// <param name="KeyID"></param>
/// <param name="KeyValue"></param>
/// <param name="KeyTime"></param>
void Text_KeyStatus(string BaseTag, int KeyID, string KeyValue, double KeyTime)
{
Text_KeyStatusSN(BaseTag, KeyID.ToString(), KeyValue, KeyTime);
}
#region IResponse 成员
public event ResponseEventHander ResponseEventHander;
/// <summary>
/// 修改:杨斌 2012-06-27
/// </summary>
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();
}
}
/// <summary>
/// 基站连接类
/// </summary>
public SunVote.BaseConnection BaseConnection { get; set; }
/// <summary>
/// 幻灯片Tag值
/// </summary>
public TagSet TagSet { get; set; }
/// <summary>
/// 反馈类型
/// </summary>
public ResponseType ResponseType { get; set; }
#endregion
}
}