//////////////////////////////////////////////////////////////////////////////// /// Signal Type Logic Scripts /// MSTS China Signal script /// Original script by PeiPei /// Modified by HouPeng /// China Signal 3 & 4 signal model mixed version 2005.4.6 /// China Signal DiaoChe Repair by HouPeng 2004.4.6 /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjinzhanLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1 || next_state ==# SIGASP_APPROACH_2) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzb extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzbs extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_CLEAR_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjinzhan18Light extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzb18 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state if( state ==# SIGASP_APPROACH_1 && ( next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING ) ) draw_state = 2; else draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzb18s extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjinluLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else if (next_state ==# SIGASP_APPROACH_3) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINA_JieCheJinLu extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else { state = SIGASP_CLEAR_2; } } draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzba extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzba18 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state if( state ==# SIGASP_APPROACH_1 && ( next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING ) ) draw_state = 2; else draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzdg // CHINA jinlu Double Green S3-2 divergence extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3 ) { state = SIGASP_CLEAR_2; } else if (next_state ==# SIGASP_CLEAR_1) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzdgs extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else { state = SIGASP_CLEAR_1; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAtongguoLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; if (!enabled || block_state() !=# BLOCK_CLEAR || !route_set()) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAtongguoLight_3s extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; if (!enabled || block_state() !=# BLOCK_CLEAR || !route_set()) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_2; // different for 3 Signal mode } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAchuzhanLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else //if (next_state ==# SIGASP_CLEAR_1 || // next_state ==# SIGASP_CLEAR_2) { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAchuzhanLight_3s extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_2; // different for 3 Signal mode } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAWarnLight extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; state = next_sig_lr (SIGFN_NORMAL); // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINARepeater extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; state = next_sig_lr (SIGFN_NORMAL); // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjinzhanfushiLight extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; state = next_sig_lr (SIGFN_NORMAL); // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SCRIPT CHINADCQC1Light extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat ==# BLOCK_OCCUPIED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_RESTRICTING; } else { state = SIGASP_APPROACH_1; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINARepeaterjl // Just same as above // CHINA Fachejinlu BSHQ extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; state = next_sig_lr (SIGFN_NORMAL); // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINADCQC2Light extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat ==# BLOCK_OCCUPIED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); { state = SIGASP_APPROACH_1; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINADCQC3Light extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_STOP; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else if (next_state ==# SIGASP_APPROACH_2) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_3) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_CLEAR_1) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINA3stgLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; if (!enabled || block_state() !=# BLOCK_CLEAR || !route_set()) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_2; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINA4stgLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; if (!enabled || block_state() !=# BLOCK_CLEAR || !route_set()) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAJintouxianR extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAJintouxianW extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINATuoFengLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_1; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAchuzhanLight-22 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING ) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJhdg extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJdcw extern float block_state (); extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJdcw22 extern float block_state (); extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); // may be useful for clear next signal state = SIGASP_APPROACH_1; // Double Yellow } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJhdgs extern float block_state (); extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJQStgLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; if (!enabled || block_state() !=# BLOCK_CLEAR || !route_set()) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else //if (next_state ==# SIGASP_CLEAR_1 || // next_state ==# SIGASP_CLEAR_2) { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJQSCZLight extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else if (next_state ==# SIGASP_APPROACH_3) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJQSJZ18Light extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); //////////////////////////////////////////////////////////////////////// SCRIPT CHINAjinzhanLight_3s extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_2; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjinluLight_3s extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || // Not enabled/cleared to show natural state? block_stat !=# BLOCK_CLEAR || // Block ahead not clear? !route_seted) // Switch not set as per link? { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_CLEAR_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_2; // different for 3 Signal mode } else //if (next_state ==# SIGASP_CLEAR_1 || // next_state ==# SIGASP_CLEAR_2) { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAchuzhanLight-3auto extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || // Not enabled/cleared to show natural state? block_stat !=# BLOCK_CLEAR || // Block ahead not clear? !route_seted) // Switch not set as per link? { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING ) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT d1 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; if (!enabled || block_state() !=# BLOCK_CLEAR || !route_set()) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_STOP; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_cz_Half extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_CLEAR_2; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_cz_HAS extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_CLEAR_2; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_GH200_CDH extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_GH200_CDW extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_GH200s_CDH extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_CZDG_HDC extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else if (next_state ==# SIGASP_CLEAR_1) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_CZDG extern float block_state (); extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJhdg3 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJhdg_3 extern float block_state (); extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_CLEAR_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJHDG_DC3 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT BJHDG_DC4 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1 || next_state ==# SIGASP_APPROACH_2) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_CZDG4 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_CLEAR_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_CZDG4w extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_DGJLDY extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_DiaoChe_Distance extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; state = next_sig_lr (SIGFN_NORMAL); // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHNGHJJ extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; if (!enabled || block_state() !=# BLOCK_CLEAR || !route_set()) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjinzhan200Light extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; // Use red + white instead red light } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_DGJLDFY extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float sig_feature (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state if( state ==# SIGASP_APPROACH_1 && ( next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING ) ) draw_state = 2; else draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINAjzo18 extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state if( state ==# SIGASP_APPROACH_1 && ( next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING ) ) draw_state = 2; else draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHNczdy extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_APPROACH_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINATuoFengfs extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_STOP_AND_PROCEED; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED || next_state ==# SIGASP_RESTRICTING) { state = SIGASP_APPROACH_2; } else if (next_state ==# SIGASP_APPROACH_1) { state = SIGASP_APPROACH_1; } else if (next_state ==# SIGASP_APPROACH_2 || next_state ==# SIGASP_APPROACH_3) { state = SIGASP_APPROACH_3; } else if (next_state ==# SIGASP_CLEAR_1) { state = SIGASP_CLEAR_1; } else { state = SIGASP_CLEAR_2; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHINATuoFengfsw extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; } else { next_state = next_sig_lr (SIGFN_NORMAL); if (next_state ==# SIGASP_STOP || next_state ==# SIGASP_STOP_AND_PROCEED) { state = SIGASP_RESTRICTING; } else { state = SIGASP_APPROACH_1; } } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// SCRIPT CHN_ODG extern float block_state (); extern float route_set (); extern float next_sig_lr (); extern float def_draw_state (); extern float sig_feature (); extern float state; extern float draw_state; extern float enabled; float next_state; float block_stat; float route_seted; block_stat = block_state(); route_seted = route_set(); if (!enabled || block_stat !=# BLOCK_CLEAR || !route_seted) { state = SIGASP_STOP; if( sig_feature(SIGFEAT_USER1) && route_seted && block_stat !=# BLOCK_JN_OBSTRUCTED ) state = SIGASP_RESTRICTING; } else { next_state = next_sig_lr (SIGFN_NORMAL); state = SIGASP_CLEAR_1; } // Get draw state draw_state = def_draw_state (state); /////////////////////////////////////////////////////////////////////////////// // End of File