62 std::string base =
"Call Station " +
ToString(number);
76 timer =
new Timer(
"Input Timeout Timer",
this);
117 Report(
"Creating button panel");
119 panel =
new ButtonPanel(
this, 1, texture, rows, columns, direction, 0, 0, buttonwidth, buttonheight, spacingX, spacingY, 0, tw, th);
259 indicator =
new Indicator(
this, sound, texture_prefix, blank_texture, direction, CenterX, CenterZ, width, height, voffset, timer_duration);
275 if (text.length() != 1)
292 if ((StarCount > 1 || MinCount > 1) &&
InputCache.length() > 1)
364 std::string converted =
ToString(rawfloor);
372 result = floorobj->
Number;
377 result = floorobj2->
Number;
394 std::string message =
"XX";
421 if (Direction ==
"front")
423 if (ButtonPos.x > ShaftPos.x)
428 else if (Direction ==
"back")
430 if (ButtonPos.x < ShaftPos.x)
435 else if (Direction ==
"left")
437 if (ButtonPos.z < ShaftPos.z)
442 else if (Direction ==
"right")
444 if (ButtonPos.z > ShaftPos.z)
470 if (direction ==
true)
487 Report(
"Call: finding grouped call buttons");
490 std::vector<CallStation*> stations;
495 for (
size_t i = 0; i < stations.size(); i++)
498 stations[i]->SetLights(up, down);
534 Report(
"SetLights: up light already in requested status");
539 Report(
"SetLights: turning on up light");
550 Report(
"SetLights: up light already in requested status");
555 Report(
"SetLights: turning off up light");
566 Report(
"SetLights: down light already in requested status");
571 Report(
"SetLights: turning on down light");
581 Report(
"SetLights: down light already in requested status");
586 Report(
"SetLights: turning off down light");
632bool CallStation::CreateCallButtons(
const std::string &sound_file_up,
const std::string &sound_file_down, std::string BackTexture,
const std::string &UpButtonTexture,
const std::string &UpButtonTexture_Lit,
const std::string &DownButtonTexture,
const std::string &DownButtonTexture_Lit,
const std::string &direction,
Real BackWidth,
Real BackHeight,
bool ShowBack,
Real tw,
Real th)
639 if (ShowBack ==
false)
644 bool UpExists =
false;
645 bool DownExists =
false;
658 if (UpExists ==
true)
660 if (DownExists ==
true)
664 Real button_height = BackHeight / 3.5;
665 Real button_width = BackWidth / 2;
666 Real h_spacing = 0.5;
667 Real v_spacing = 1.25;
668 if (UpExists ==
true && DownExists ==
true)
671 panel =
new ButtonPanel(
this, 1, BackTexture, rows, 1, direction, 0, 0, button_width, button_height, h_spacing, v_spacing, BackHeight / 2, tw, th,
false);
675 Report(
"Creating controls");
677 if (UpExists ==
true)
680 std::vector<std::string> names, textures;
682 textures.emplace_back(UpButtonTexture);
683 textures.emplace_back(UpButtonTexture_Lit);
685 names.emplace_back(
"off");
686 names.emplace_back(
"up");
688 panel->
AddControl(sound_file_up, row, 1, 1, 1, 0, 0, 1, names, textures);
690 if (DownExists ==
true)
693 if (UpExists ==
true)
696 std::vector<std::string> names, textures;
698 textures.emplace_back(DownButtonTexture);
699 textures.emplace_back(DownButtonTexture_Lit);
701 names.emplace_back(
"off");
702 names.emplace_back(
"down");
704 panel->
AddControl(sound_file_down, row, 1, 1, 1, 0, 0, 1, names, textures);
Timer(const std::string &name, CallStation *parent)
void ReportElevator(Elevator *elevator)
bool SelectFloor(int floor)
void SetLightsGroup(int up, int down)
bool GetFloorFromID(const std::string &floor, int &result)
void UpdateIndicator(const std::string &text, bool play_sound=true)
std::vector< std::string > InvalidInput
DispatchController * GetController()
void SetController(int number)
bool ServicesElevator(int elevator)
void DownLight(bool value)
ButtonPanel * CreateButtonPanel(const std::string &texture, int rows, int columns, const std::string &direction, Real width, Real height, Real spacingX, Real spacingY, Real tw, Real th)
bool Input(const std::string &text)
bool ReportError(const std::string &message)
Control * GetDownControl()
void Report(const std::string &message)
int GetElevatorArrived(int starting_floor, int destination_floor)
int GetElevatorArrivedStandard(int floor, bool direction)
CallStation(Object *parent, int floornum, int number)
void SetLights(int up, int down)
void SetPosition(Vector3 &position)
bool FireService(int value)
bool Call(bool direction)
Indicator * AddIndicator(const std::string &sound, const std::string &texture_prefix, const std::string &blank_texture, const std::string &direction, Real CenterX, Real CenterZ, Real width, Real height, Real voffset, Real timer_duration)
bool CreateCallButtons(const std::string &sound_file_up, const std::string &sound_file_down, std::string BackTexture, const std::string &UpButtonTexture, const std::string &UpButtonTexture_Lit, const std::string &DownButtonTexture, const std::string &DownButtonTexture_Lit, const std::string &direction, Real BackWidth, Real BackHeight, bool ShowBack, Real tw, Real th)
bool Press(bool reverse=false)
bool SetSelectPosition(int position)
bool ServicesElevator(int elevator)
std::vector< CallStation * > GetCallStations(int floor)
bool FireService(int value)
int GetElevatorArrived(int starting_floor, int destination_floor)
bool CallElevator(CallStation *station, bool direction)
void UnregisterCallStation(CallStation *station)
int GetElevatorArrivedStandard(int floor, bool direction)
void RegisterCallStation(CallStation *station)
bool RequestRoute(CallStation *station, int starting_floor, int destination_floor)
Floor * GetByID(const std::string &id)
Floor * GetByNumberID(const std::string &id)
void RemoveCallStation(CallStation *station)
Real GetBase(bool relative=false)
void Update(const std::string &text, bool play_sound=true)
virtual bool ReportError(const std::string &message)
virtual void Report(const std::string &message)
void SetName(const std::string &name)
virtual Vector3 GetPosition(bool relative=false)
void SetValues(const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
virtual void SetPosition(const Vector3 &position)
FloorManager * GetFloorManager()
DispatchController * GetController(int number)
Floor * GetFloor(int number)
TextureManager * GetTextureManager()
void EnableLighting(const std::string &material_name, bool value)
void Start(int milliseconds=-1, bool oneshot=false)
int ToInt(const std::string &string)
std::string ToString(int number)
bool IsNumeric(char character)
#define SBS_PROFILE(name)