110 lines
4.5 KiB
C
110 lines
4.5 KiB
C
/*
|
|
* control_station_project.h
|
|
*
|
|
* Created on: 1 èþí. 2020 ã.
|
|
* Author: Yura
|
|
*/
|
|
|
|
#ifndef SRC_MAIN_CONTROL_STATION_PROJECT_H_
|
|
#define SRC_MAIN_CONTROL_STATION_PROJECT_H_
|
|
|
|
|
|
#define POS_STATION_CMD_ANOTHER_BSU1 15 // ïîçèöèÿ â ìàññèâå äëÿ CONTROL_STATION_CMD äëÿ ïåðåäà÷è â äðóãîé ÁÑ
|
|
|
|
|
|
// êàêèå ïîñòû âîçìîæíû:
|
|
/*
|
|
* òåðìèíàë - RS232 - äèñòàíöèÿ îò PC
|
|
* òåðìèíàë - CAN - äèñòàíöèÿ îò PC
|
|
* ïóëüò ingeteam - RS485
|
|
* ïóëüò ÌÏÓ ÑÂÓ- RS485
|
|
* ïóëüò ÌÏÓ ÑÂÓ - CAN
|
|
* ïóëüò ÌÏÓ Êëàâà - RS485
|
|
* ïóëüò ÌÏÓ Êëàâà - CAN
|
|
* Çàäàò÷èê íà áñó - CAN
|
|
* Çàäàò÷èê ÂÏÓ - CAN
|
|
* Çàäàò÷èê ÂÏÓ2 - CAN
|
|
* Çàäàò÷èê ÂÏÓ-ÀÏ - CAN
|
|
*
|
|
*/
|
|
|
|
enum
|
|
{
|
|
CONTROL_STATION_TERMINAL_RS232 = 0,
|
|
CONTROL_STATION_TERMINAL_CAN,
|
|
|
|
CONTROL_STATION_INGETEAM_PULT_RS485,
|
|
CONTROL_STATION_MPU_SVU_CAN, // svu
|
|
CONTROL_STATION_MPU_KEY_CAN, // bsu key
|
|
CONTROL_STATION_MPU_SVU_RS485, // ?
|
|
CONTROL_STATION_MPU_KEY_RS485, // ?
|
|
CONTROL_STATION_ZADATCHIK_CAN, // bsu zo
|
|
CONTROL_STATION_VPU_CAN, // vpu
|
|
CONTROL_STATION_ANOTHER_BS, // îò äðóãîãî ÁÑ â ðåæèìå slave/master
|
|
CONTROL_STATION_LAST // ïîñëåäíèé êîä â ñïèñêå, âñåãäà äîëæåí áûòü, íå óäàëÿòü åãî, èñïîëüçóåì äëÿ ðàçìåðíîñòè ìàññèâà.
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
CONTROL_STATION_CMD_GO = 0,// cmd_go îò ïîñòà ïóñê/ñòîï ØÈÌà
|
|
CONTROL_STATION_CMD_SET_IZAD,// òîê îò ïîñòà
|
|
CONTROL_STATION_CMD_SET_ROTOR,// îáîðîòû îò ïîñòà
|
|
CONTROL_STATION_CMD_SET_POWER,// ìîùíîñòü îò ïîñòà
|
|
CONTROL_STATION_CMD_CHARGE, // ñáîð ñõåìû îò ïîñòà
|
|
CONTROL_STATION_CMD_UNCHARGE, // ðàçáîð ñõåìû îò ïîñòà
|
|
CONTROL_STATION_CMD_CHECKBACK,// êâèòèðîâàíèå îò ïîñòà
|
|
CONTROL_STATION_CMD_TEST_LEDS,// òåñò ëàìï îò ïîñòà
|
|
CONTROL_STATION_CMD_ACTIVE_CONTROL,// ýòîò ïîñò àêòèâèðîâàí, íàïðèìåð ãàëî÷êà Äèñòàíöèÿ âêëþ÷åíà íà òåðìèíàëêå.
|
|
// à íà êàêèõ-òî ïîñòàõ âíåøíèå ïåðåêëþ÷àòåëè âêëþ÷åíû
|
|
CONTROL_STATION_CMD_UFCONST_VECTOR,// Mode 0-ufconst, 1 - ñêàëÿð/âåêòîðíîå
|
|
CONTROL_STATION_CMD_ROTOR_POWER, // Mode 0-îáîðîòû, 1 - ìîùíîñòü
|
|
CONTROL_STATION_CMD_SCALAR_FOC, // Mode 0-ñêàëÿð, 1 - âåêòîðíîå
|
|
CONTROL_STATION_CMD_SET_KM,// Km äëÿ Mode 0-ufconst
|
|
// CONTROL_STATION_CMD_SET_I_VOZBUD, // Çàäàíèå òîêà âîçáóäèòåëÿ
|
|
CONTROL_STATION_CMD_SET_U_ZARYAD, // Çàäàíèå íàïðÿæåíèÿ çàðÿäà ÇÏÒ
|
|
CONTROL_STATION_CMD_SET_K_U_DISBALANCE, // Çàäàíèå Ê íàïðÿæåíèÿ äèñáàëàíñà êîýô. îáðàòíîé ñâÿçè ïî äèñáàëàíñó, íàäî >0 ÷òîá ðàáîòàë àëãîðèòì
|
|
CONTROL_STATION_CMD_SET_K_PLUS_U_DISBALANCE, //kplus_u_disbalance, åñëè =0, òî ðàáîòàåò àëãîðèòì äèñáàëàíñà, ñ÷èòàåòñÿ ýòî êîýô. àâòîìàòîì, åñëè <>0 òî îí çàäàí ïîñòîÿííûì.
|
|
CONTROL_STATION_CMD_MODE_PUMP, //ðåæèì ðàáîòû íàñîñà // // 0 - auto on - rand pump
|
|
// 1 - auto on 1 pump
|
|
// 2 - auto on 2 pump
|
|
// 3 - manual on 1 pump
|
|
// 4 - manual on 2 pump
|
|
// 5- ïåðåõîä èç manual â íåïîíÿòíîå ñîñòîÿíèå
|
|
CONTROL_STATION_CMD_DISABLE_ON_PUMP,
|
|
CONTROL_STATION_CMD_ENABLE_ON_CHARGE,
|
|
CONTROL_STATION_CMD_DISABLE_ON_QTV,
|
|
CONTROL_STATION_CMD_MANUAL_DISCHARGE,
|
|
CONTROL_STATION_CMD_DISABLE_ON_UMP,
|
|
CONTROL_STATION_CMD_WDOG_OFF,
|
|
CONTROL_STATION_CMD_SET_LIMIT_POWER,// çàïàñ ìîùíîñòü îò ïîñòà
|
|
CONTROL_STATION_CMD_BLOCK_BS, // áëîêèðîâêà ñ âåðõíåãî óðîâíÿ
|
|
CONTROL_STATION_CMD_DISABLE_INTERRUPT_SYNC,
|
|
CONTROL_STATION_CMD_DISABLE_INTERRUPT_TIMER2,
|
|
CONTROL_STATION_CMD_DISABLE_RASCEPITEL, // íå óïðàâëÿòü ðàñöåïèòåëåì, åñëè îí ñâåäåí è íå ðàáîòàåò ìîòîð ðàñöåïèòåëÿ
|
|
CONTROL_STATION_CMD_PWM_TEST_LINES, // øèì ëèíèè íà 96ïèí øèíå êàê òåñòîâûå, òîëüêî äëÿ òåñòà!!!
|
|
CONTROL_STATION_CMD_STOP_LOGS, // ñòîï ëîãîâ
|
|
CONTROL_STATION_CMD_LAST // ïîñëåäíèé êîä â ñïèñêå, âñåãäà äîëæåí áûòü, íå óäàëÿòü åãî, èñïîëüçóåì äëÿ ðàçìåðíîñòè ìàññèâà.
|
|
};
|
|
|
|
|
|
void control_station_test_alive_all_control(void);
|
|
int control_station_select_active(void);
|
|
int get_current_station_control(void);
|
|
void load_parameters_from_active_control_station(int current_control);
|
|
void parse_parameters_from_all_control_station(void);
|
|
void parse_parameters_from_one_control_station_terminal_rs232(int cc);
|
|
void parse_parameters_from_one_control_station_pult_ingeteam(int cc);
|
|
void parse_parameters_from_one_control_station_pult_zadat4ik(int cc);
|
|
void parse_parameters_from_one_control_station_pult_vpu(int cc);
|
|
void parse_parameters_from_one_control_station_another_bs(int cc);
|
|
void parse_parameters_from_one_control_station_MPU_SVU(int cc);
|
|
|
|
void parse_analog_data_from_active_control_station_to_alg(void);
|
|
void parse_data_from_master_to_alg(void);
|
|
|
|
void load_parameters_from_can_control_station_to_rs232(void);
|
|
|
|
|
|
#endif /* SRC_MAIN_CONTROL_STATION_PROJECT_H_ */
|