|
|
package FLXDevice
|
|
|
|
|
|
import (
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
)
|
|
|
|
|
|
type SeatChangeData struct {
|
|
|
EventSource EventArgSource
|
|
|
EventType EventArgType
|
|
|
SeatInfos []SeatChangeEventArg
|
|
|
}
|
|
|
|
|
|
type JsonData struct {
|
|
|
EventType string
|
|
|
DeviceID string
|
|
|
Channel int
|
|
|
Address int
|
|
|
Status string
|
|
|
Spare string
|
|
|
SeatID int
|
|
|
}
|
|
|
|
|
|
type SeatChangeEventArg struct {
|
|
|
ChannelAddr byte
|
|
|
UnitAddr byte
|
|
|
CardNo int
|
|
|
CMD byte
|
|
|
DeviceGUID string
|
|
|
IsOnline bool
|
|
|
Data []byte
|
|
|
IPAddress string
|
|
|
EventValue EventArgValue
|
|
|
Value_ExtraInt int
|
|
|
Value_ExtraStr string
|
|
|
}
|
|
|
|
|
|
func newSeatChangeEventArg(deviceGUID string, channelAddr byte, unitAddr byte, online bool, cardNo int, value EventArgValue) SeatChangeEventArg {
|
|
|
|
|
|
defer func() {
|
|
|
if r := recover(); r != nil {
|
|
|
log.Error("newSeatChangeEventArg:", r)
|
|
|
}
|
|
|
}()
|
|
|
|
|
|
var newSeatevent SeatChangeEventArg
|
|
|
newSeatevent.DeviceGUID = deviceGUID
|
|
|
newSeatevent.ChannelAddr = channelAddr
|
|
|
newSeatevent.UnitAddr = unitAddr
|
|
|
newSeatevent.IsOnline = online
|
|
|
newSeatevent.CardNo = cardNo
|
|
|
newSeatevent.EventValue = value
|
|
|
|
|
|
return newSeatevent
|
|
|
}
|
|
|
|
|
|
func newSeatChangeEventArgSimple(deviceGUID string, channelAddr byte, unitAddr byte) SeatChangeEventArg {
|
|
|
|
|
|
defer func() {
|
|
|
if r := recover(); r != nil {
|
|
|
log.Error("newSeatChangeEventArgSimple:", r)
|
|
|
}
|
|
|
}()
|
|
|
|
|
|
var newSeatevent SeatChangeEventArg
|
|
|
newSeatevent.DeviceGUID = deviceGUID
|
|
|
newSeatevent.ChannelAddr = channelAddr
|
|
|
newSeatevent.UnitAddr = unitAddr
|
|
|
return newSeatevent
|
|
|
}
|
|
|
|
|
|
type SeatInfo struct {
|
|
|
IsAttendance bool
|
|
|
EnabledBrowse bool
|
|
|
EnabledCall bool
|
|
|
EnabledCheckedIn bool
|
|
|
EnabledSpeak bool
|
|
|
IsChairman bool
|
|
|
IsSpeakHighPriority bool
|
|
|
EnabledVote bool
|
|
|
SeatChangeEventArg
|
|
|
}
|
|
|
|
|
|
type TopicType int
|
|
|
|
|
|
const (
|
|
|
/// <summary>表决</summary>
|
|
|
Vote TopicType = 1
|
|
|
|
|
|
/// <summary>讨论</summary>
|
|
|
Speak TopicType = 2
|
|
|
|
|
|
/// <summary>审议</summary>
|
|
|
Report TopicType = 3
|
|
|
|
|
|
/// <summary>选举</summary>
|
|
|
Election TopicType = 4
|
|
|
|
|
|
/// <summary>测评</summary>
|
|
|
Evaluation TopicType = 5
|
|
|
|
|
|
/// <summary>专题询问</summary>
|
|
|
Asked TopicType = 6
|
|
|
|
|
|
/// <summary>通过会议议程</summary>
|
|
|
PassAgenda TopicType = 7
|
|
|
|
|
|
/// <summary>打分测评</summary>
|
|
|
Scoring TopicType = 8
|
|
|
|
|
|
/// <summary>报告</summary>
|
|
|
Presentation TopicType = 9
|
|
|
)
|
|
|
|
|
|
type VoteShow int
|
|
|
|
|
|
const (
|
|
|
/// <summary>
|
|
|
/// 不显示结果
|
|
|
/// </summary>
|
|
|
VoteShow_Default VoteShow = 1
|
|
|
/// <summary>
|
|
|
/// 简单结果
|
|
|
/// </summary>
|
|
|
VoteShow_Simple VoteShow = 2
|
|
|
/// <summary>
|
|
|
/// 详细结果
|
|
|
/// </summary>
|
|
|
VoteShow_Detailed VoteShow = 3
|
|
|
)
|
|
|
|
|
|
type SpeakMothod int
|
|
|
|
|
|
const (
|
|
|
/// <summary>申请发言</summary>
|
|
|
SpeakMothod_ApplySpeak SpeakMothod = 1
|
|
|
/// <summary>抢答发言</summary>
|
|
|
SpeakMothod_RobSpeak SpeakMothod = 2
|
|
|
/// <summary>排队发言</summary>
|
|
|
SpeakMothod_QueueSpeak SpeakMothod = 3
|
|
|
/// <summary>自由发言</summary>
|
|
|
SpeakMothod_FreeSpeak SpeakMothod = 4
|
|
|
)
|
|
|
|
|
|
type ReportMethod int
|
|
|
|
|
|
const (
|
|
|
/// <summary>插卡报到(指定就坐)</summary>
|
|
|
ReportMethod_SPECIFY_IC ReportMethod = 37
|
|
|
/// <summary>按键报到</summary>
|
|
|
ReportMethod_Presskey ReportMethod = 38
|
|
|
/// <summary>门口报到</summary>
|
|
|
ReportMethod_Door ReportMethod = 40
|
|
|
/// <summary>发言键报到</summary>
|
|
|
ReportMethod_SpeakKey ReportMethod = 41
|
|
|
/// <summary>唤醒即报到</summary>
|
|
|
ReportMethod_Active ReportMethod = 42
|
|
|
///// <summary>IC卡自由就座</summary>
|
|
|
ReportMethod_Free_IC ReportMethod = 43
|
|
|
)
|
|
|
|
|
|
type VoteMethod int
|
|
|
|
|
|
const (
|
|
|
/// <summary>最后一次键盘有效的不公开表决</summary>
|
|
|
VoteMethod_LastKeyValid VoteMethod = 0
|
|
|
|
|
|
/// <summary>第一次按键有效的不公开表决</summary>
|
|
|
VoteMethod_FirstKeyValid VoteMethod = 1
|
|
|
|
|
|
/// <summary>最后一次键盘有效的公开表决</summary>
|
|
|
VoteMethod_AllowModify VoteMethod = 2
|
|
|
|
|
|
/// <summary>第一次按键有效的公开表决</summary>
|
|
|
VoteMethod_NotAllowModify VoteMethod = 3
|
|
|
)
|
|
|
|
|
|
type SeatMethod int
|
|
|
|
|
|
const (
|
|
|
/// <summary>指定座席</summary>
|
|
|
SeatMethod_FixedSeat SeatMethod = 44
|
|
|
/// <summary>自由就坐</summary>
|
|
|
SeatMethod_FreeSeat SeatMethod = 43
|
|
|
)
|
|
|
|
|
|
type RunStatus int
|
|
|
|
|
|
const (
|
|
|
/// <summary>未开始</summary>
|
|
|
RunStatus_UnStart RunStatus = -1
|
|
|
/// <summary>开始</summary>
|
|
|
RunStatus_Start RunStatus = 0
|
|
|
/// <summary>暂停</summary>
|
|
|
RunStatus_Pause RunStatus = 1
|
|
|
/// <summary>继续</summary>
|
|
|
RunStatus_Resume RunStatus = 2
|
|
|
/// <summary>停止</summary>
|
|
|
RunStatus_Stop RunStatus = 3
|
|
|
)
|
|
|
|
|
|
type EventArgSource int
|
|
|
|
|
|
const (
|
|
|
/// <summary>报到机</summary>
|
|
|
EventArgSource_SivtChecker = 0 //报道门
|
|
|
/// <summary>表决器</summary>
|
|
|
EventArgSource_SivtVoiceDevice = 1 //表决器
|
|
|
/// <summary>设备查询</summary>
|
|
|
EventArgSource_SivtDelegateDevice = 2 //设备查询
|
|
|
/// <summary>服务器</summary>
|
|
|
EventArgSource_SeverDevice = 3 //服务器
|
|
|
/// <summary>客户端</summary>
|
|
|
EventArgSource_ClientDevice = 4 //客户端
|
|
|
/// <summary>智能设备</summary>
|
|
|
EventArgSource_SivtPadDevice = 5 //会务机
|
|
|
)
|
|
|
|
|
|
type EventArgType int
|
|
|
|
|
|
const (
|
|
|
/// <summary>设备查询事件</summary>
|
|
|
EventArgType_DeviceQueryEvent = 0
|
|
|
/// <summary>呼叫事件</summary>
|
|
|
EventArgType_CallServiceEvent = 1
|
|
|
/// <summary>表决事件</summary>
|
|
|
EventArgType_VoteEvent = 2
|
|
|
/// <summary>发言事件</summary>
|
|
|
EventArgType_SpeakEvent = 3
|
|
|
/// <summary>报到事件</summary>
|
|
|
EventArgType_RegisterEvent = 4
|
|
|
/// <summary>下线事件</summary>
|
|
|
EventArgType_OnlineOffEvent = 5
|
|
|
/// <summary>消息事件</summary>
|
|
|
EventArgType_InfoMessage = 6
|
|
|
/// <summary>响应读输入端口状态</summary>
|
|
|
EventArgType_ReaderStatus = 7
|
|
|
/// <summary>控制器回送输入端口状态数据</summary>
|
|
|
EventArgType_InputPortStatus = 8
|
|
|
/// <summary>文件上传事件</summary>
|
|
|
EventArgType_FileUpload = 9
|
|
|
/// <summary>服务器发送客户端事件</summary>
|
|
|
EventArgType_ServerToClient = 10
|
|
|
/// <summary>客户端发送服务器事件</summary>
|
|
|
/// <summary>视频事件</summary>
|
|
|
EventArgType_ClientToServer = 11
|
|
|
)
|
|
|
|
|
|
type EventArgValue int
|
|
|
|
|
|
const (
|
|
|
/// <summary>未知</summary>
|
|
|
EventArgValue_Unknown = 0
|
|
|
/// <summary>未报到</summary>
|
|
|
EventArgValue_UnRegister = 1
|
|
|
/// <summary>已报到</summary>
|
|
|
EventArgValue_Register = 2
|
|
|
/// <summary>销报</summary>
|
|
|
EventArgValue_UnBackReg = 3
|
|
|
/// <summary>补报</summary>
|
|
|
EventArgValue_BackReg = 4
|
|
|
/// <summary>赞成</summary>
|
|
|
EventArgValue_Vote1Key = 5
|
|
|
/// <summary>反对</summary>
|
|
|
EventArgValue_Vote2Key = 6
|
|
|
/// <summary>弃权</summary>
|
|
|
EventArgValue_Vote3Key = 7
|
|
|
/// <summary>加权</summary>
|
|
|
EventArgValue_Vote4Key = 8
|
|
|
/// <summary>减权</summary>
|
|
|
EventArgValue_Vote5Key = 9
|
|
|
/// <summary>未按键</summary>
|
|
|
EventArgValue_NoPress = 10
|
|
|
/// <summary>正在发言</summary>
|
|
|
EventArgValue_SpeakOn = 11
|
|
|
/// <summary>关闭发言</summary>
|
|
|
EventArgValue_SpeakOff = 12
|
|
|
/// <summary>申请发言</summary>
|
|
|
EventArgValue_ApplyOn = 13
|
|
|
/// <summary>取消申请发言</summary>
|
|
|
EventArgValue_ApplyOff = 14
|
|
|
/// <summary>???</summary>
|
|
|
EventArgValue_MicLedAlarm = 15
|
|
|
/// <summary>???</summary>
|
|
|
EventArgValue_MicLedNoAlarm = 16
|
|
|
/// <summary>呼叫</summary>
|
|
|
EventArgValue_CallService = 17
|
|
|
/// <summary>销呼</summary>
|
|
|
EventArgValue_UnCallService = 18
|
|
|
/// <summary>报到机响应读输入端口状态</summary>
|
|
|
EventArgValue_RegistrStatus = 19
|
|
|
/// <summary>报到机回送输入端口状态数据</summary>
|
|
|
EventArgValue_RegistrInputPortStatus = 20
|
|
|
/// <summary>Pad会标</summary>
|
|
|
EventArgValue_PadTitle = 21
|
|
|
/// <summary>Pad消息</summary>
|
|
|
EventArgValue_PadMessage = 22
|
|
|
)
|
|
|
|
|
|
type CongressStep int
|
|
|
|
|
|
const (
|
|
|
CongressStep_UnStart = 0
|
|
|
CongressStep_Start = 1
|
|
|
CongressStep_StartAttendance = 2
|
|
|
CongressStep_EndAttendance = 3
|
|
|
CongressStep_StartTopic = 4
|
|
|
CongressStep_StartVote = 5
|
|
|
CongressStep_EndVote = 6
|
|
|
CongressStep_EndTopic = 7
|
|
|
)
|