#ifndef _LIST_LED_H
#define _LIST_LED_H

#include "dlsymb.h"
#include "cdlfxpro.h"

//led灯的数量
#define LEDNUMBER 8
//led灯左右空格
#define LEDSPACE 2

//led灯序号最大输入字符数
#define LISTORDER 3

struct Set_joint{
	
//接头can id 号
unsigned char canid[4];

//接头和电缆文件中对应接头顺序 
int order;

//接头芯数
int core;


//led灯显示
int led;

//输入接头顺序
char strorder[4];

struct Set_joint operator =(struct Set_joint & jt)
{
  for(int i=0;i<4;i++)
  {canid[i]=jt.canid[i];
   strorder[i]=jt.strorder[i];
  }
  order=jt.order;
  core=jt.core;
  led=jt.led;
  
  return *this;  
}

};



class CList_Led:public CObject
{
private:
        //BOOL m_bState;
	      int m_nBoxColor;
	      int m_nSelColor;
	      
	      int m_ncur_opt;
	      int m_ntop_opt;
	      int m_noffset;
	      int m_npri_opt;	
	      int m_ny; 
	      
	      CEdit       *m_pEdit;
	      
	      BOOL m_bredraw;
	      
	      
	      int m_nLedLen;//每格灯宽度
	      int m_nLedRad;//每个等显示半径
	      
	           
	      struct Set_joint *m_pJoint;
	      int m_njointnum;
	      
public:
       //设置接头数据
       void SetJoint(struct Set_joint *pJoint,int jointnum){m_pJoint=pJoint;m_njointnum=jointnum;};
       //获得接头数据
       struct Set_joint * GetJoint(int &jointnum){jointnum= m_njointnum;return(m_pJoint);}
       //列表选择
       void List_Select(int nKey);

       //void List_Input(int nkey);
       //画列表
       void drawlist();
       //画led灯
       void Drawled(int nLeft,int nTop,int nindex);  
        //画列表
       void draw(); 
      //输入数据        
       int Input();

public:
       virtual BOOL  Show();

       //virtual void  KillFocus();
       virtual void  SetFocus();

       virtual int   Swapping();

public:
       CList_Led(CObject* pParent);
       ~CList_Led();
};



#endif