#pragma once

#include "Datastruct.h"
#include "BAS_DRAW_FUN1.h"
#include "BaseLine.h"
#include "CalJXAndGD.h"
#include "StationDataBase.h"
#include "Datastruct.h"

//此类用于计算工程数量

class CCalGCSLTool : public BAS_DRAW_FUN
{
public:
	vector<ZCGTZX*> pGTZXArray;
	vector<ZCGTZX*> pGTZXArray_SEL;   //股道
	CString m_MdbName;
	int isneedarea;
	StationDataBase DBS;
	CBaseLine* pBaseLine;
	CalJXAndGD pCalJXAndGD;
	ShuLiangJY OneShuliang;
	vector<ShuLiangJY> HNTZShuliangArray, MZShuliangArray;//最终整合
	vector<ShuLiangJY>  HNTZShuliangArrayZX, MZShuliangArrayZX;//正线
	vector<ShuLiangJY> DCShuliangArray, DXShuliangArray, ZHDCShuliangArray;//道岔、渡线、组合道岔数量
	vector<ShuLiangJY> ZTShuliangArray;
	vector<ShuLiangJY> PGDShuliangArray;
	vector<ShuLiangJY> RDShuliangArray;
	struct SwitchContent {
		CString TuHao; // 图号
		int SwitchNum; // 辙岔号
		int SwitchType; //道岔类型1.普通单开2.对称双开3.对称三开4.交分5.菱形交叉
		int LeftorRight; // 左右开
		int TrackType; // 钢轨类型
		vector<CString> SwitchName; // 道岔外部编号
		SwitchContent()
		{
			TuHao = L"";
			SwitchNum = 0;
			SwitchType = 0;
			SwitchName.clear();
			LeftorRight = 0;
			TrackType = 0;
		}
		~SwitchContent()
		{
			TuHao = L"";
			SwitchNum = 0;
			SwitchType = 0;
			SwitchName.clear();
			LeftorRight = 0;
			TrackType = 0;
		}
	};
	// 设备标注信息结构体
	struct DeviceInf {
		int Type; // 1 道岔 2 围墙  3 车挡
		ACHAR BianHaoZT[STR_NORMAL];
		int BZBianHao;
		ACHAR Ckml[STR_SHORT]; // 里程
		double Dist; // 坐标Y
		ACHAR  BianHao[STR_NORMAL]; // 内部编号
		ACHAR CZJXStrArray[STR_NORMAL]; //参照基线编号
		double SignDist2Swi; // 信号机距岔心距离
		double WarnDist2Swi; // 警冲标距岔心距离
		DeviceInf()
		{
			Type = 0; // 1 道岔 2 围墙  3 车挡
			_tcscpy(BianHaoZT, L"");
			BZBianHao = 0;
			_tcscpy(Ckml, L""); // 里程
			Dist = 0.0; // 坐标Y
			_tcscpy(BianHao, L""); // 内部编号
			_tcscpy(CZJXStrArray, L""); //参照基线编号
			SignDist2Swi = 0.0; // 信号机距岔心距离
			WarnDist2Swi = 0.0; // 警冲标距岔心距离
		}
		~DeviceInf()
		{
			Type = 0; // 1 道岔 2 围墙  3 车挡
			_tcscpy(BianHaoZT, L"");
			BZBianHao = 0;
			_tcscpy(Ckml, L""); // 里程
			Dist = 0.0; // 坐标Y
			_tcscpy(BianHao, L""); // 内部编号
			_tcscpy(CZJXStrArray, L""); //参照基线编号
			SignDist2Swi = 0.0; // 信号机距岔心距离
			WarnDist2Swi = 0.0; // 警冲标距岔心距离
		}
	};

	//道岔分为上下行两组
	vector<Switch> SXDCArray, XXDCArray;//上下行单开道岔数组
	vector<Switch> SXJCDXArray, XXJCDXArray;//交叉渡线道岔数组
	vector<Switch> SXFSJFArray, XXFSJFArray;//上下行复式交分数组

	//道岔分为上下行两组岔间
	vector<Switch> SXDCCJArray, XXDCCJArray;

	GCSL_Sta GCSL_Data;
	//计算数量(为了枢纽)
	void FORM_SNSL(CString mdbname);
	vector<LeftShuLinag>AddtionalShuLiang;
	//道岔调配表
	vector<Switch> DCDPArray;//既有拆铺

	//股道表
	vector<GDB>GDBArray;
	void CalGDBData(int& RowNum);
	vector<LMD> pLMDArray_SEL;//龙门吊
	vector<Switch> pSwitchArray_SEL;//道岔


};

