PlantUML Activity diagram special Box Layout Output is needed - layout

I have a problem and tried to solve it for the last 2 Days.
I want to design an activity diagram/flow chart like this:
Step1
Step2
Step3 --------->Output of Step 3
Step4
I can't draw/program an arrow which starts directly out of the box "Step3" and the Box "Output of Step 3" too without any layout problems.
My current code:
#startuml Test1
title Flowchart
|System 1|
start
:Step1;
:Step2;
split
:Step3;
|System 2|
split again
:Output of Step3;
detach
|System 1|
end split
:Step 4;
stop
#enduml

Activity Diagrams in UML have certain rules. Using split is probably a bad idea, as it's intended for the SDL aspect of PlantUML.
Perhaps you can try with fork if you want to show the output in a separate swimlane:
#startuml Test1
title Flowchart
|System 1|
start
:Step1;
:Step2;
:Step3;
fork
:Step 4;
|System 2|
fork again
:Output of Step3]
stop
|System 1|
end fork
stop
#enduml
I put a stop at the end of the output (which is now an object using the ] ending) to prevent the line rejoining the flow in System 1.
Another alternative is to use the legacy syntax for Activity diagrams, which doesn't allow for swimlanes, but can do partitions.
#startuml Test2
title Flowchart
partition "System 1" {
(*) --> "Step 1"
--> "Step 2"
--> "Step 3"
--> "Step 4"
--> (*)
}
partition "System 2" {
"Step 3" -> "<< object >>\nOutput of Step 3"
}
#enduml
In the legacy syntax for Activity Diagrams, it's not possible (as far as I know) to make an "object" (rectangle) shape.

Related

Change font and time aixis labels in DyagrammeR>mermaid>gantt chart

I made this gantt chart in R using diagrammer::mermaid (reproducible code below):
It is nice, but I would like to:
Increase font size (I suppose this will make each line wider, making the current very long rectangle slightly more "square". I am fine with that)
Make the t-aixis labels more standard. The weeks for some, months for others seem very strange. I want to be able to tell the months and years apart in a concise way)
How can I implement these changes?
I am an R user with no knowledge of node.js, css, etc. I managed to find code snippets on the internet to create this, but do not understand anything about the style_widget or how to change it.
devtools::install_github('rich-iannone/DiagrammeR')
library(DiagrammeR)
library(tidyverse) #just for the pipe operator
style_widget <- function(hw=NULL, style="", addl_selector="") {
stopifnot(!is.null(hw), inherits(hw, "htmlwidget"))
# use current id of htmlwidget if already specified
elementId <- hw$elementId
if(is.null(elementId)) {
# borrow htmlwidgets unique id creator
elementId <- sprintf(
'htmlwidget-%s',
htmlwidgets:::createWidgetId()
)
hw$elementId <- elementId
}
htmlwidgets::prependContent(
hw,
htmltools::tags$style(
sprintf(
"#%s %s {%s}",
elementId,
addl_selector,
style
)
)
)
}
flx_BmP <- mermaid("
gantt
dateFormat YYYY-MM-DD
section Common
Application (1230 plants) :done, first_1, 2018-05-15, 2018-07-30
Elegible (1003) :done, first_1, 2018-06-15, 45d
Plants accept (576) :done, first_1, 2018-08-01, 2d
Q0 - Baseline (576) :done, first_1, 2018-08-02, 15d
Lottery (576) :done, first_1, 2018-09-10, 2d
section ITT (288)
Treated (223 77%) :done, first_2, 2018-09-20, 2018-12-15
Q1 :done, first_3, 2018-12-16, 2019-01-05
Q2 : first_3, 2019-06-01, 2019-06-15
section Control (288)
Q1 :done, first_3, 2018-12-16, 2019-01-05
Q2 : first_3, 2019-06-01, 2019-06-15
Treated (263) : first_3, 2019-06-16, 2019-09-15
") %>%
style_widget("display:none", "line.today")
flx_BmP
For axis format (question 1.), maybe your search for this :
axisFormat %d/%m
Doc : https://mermaidjs.github.io/gantt.html
Example :
gantt
title Gantt
dateFormat DD-MM-YYYY
axisFormat %d/%m
section One
Task One : 07-05-2019, 7d
Task Two : 09-05-2019, 7d
I don't know for the font size.
Link to a demo with your code : https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjo...

PlantUML Activity Diagram Go Back

I am using PlantUML to create an Activity diagram.
I want the arrow that comes out of Modify Details to go back to OP2 instead of the diamond.
I have this diagram:
#startuml
|Swimlane1|
start
:OP1;
|Swimlane2|
:OP2;
if (Form Valid?) then (No)
|Swimlane1|
:Modify Details; /' <-- This should point _back_ to OP2 '/
|Swimlane2|
else (Yes)
:Add Detals to System;
endif
:OP3;
|Swimlane2|
:foo5;
stop
#enduml
Which gives this image:
Can you express it with a while or repeat? Below is not quite your logic as OP2 would not always occur, but perhaps it will help you express your logic within the diagram constraints:
|Swimlane1|
start
:OP1;
|Swimlane2|
while (Form Valid) is (no)
:OP2;
|Swimlane1|
:Modify Details;
endwhile (yes)
|Swimlane2|
:Add Detals to System;
:OP3;
:foo5;
stop
#enduml

How to create a frame less Dialog box?

My goal is to create a frame-less dialog box using MFC, which are plain rectangle like shown in the image,i have basic knowledge of MFC applications.and dialog box,can you please provide some links for the same.
Copy this code
//Oninitdialog()
LONG lStyle = GetWindowLong(m_hWnd, GWL_STYLE);
lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU);
SetWindowLong(m_hWnd, GWL_STYLE, lStyle);
Second way
Select you Dialog->properties->Border->None

Powershell: Freezing GUI

Just a quick one. I have a problem with a simple tool that I've created that gets the CPU usage for a set amount of time with a small box that appears to display the % of CPU being used (I've stripped out the GUI for the code below).
function loop
{
$get = read-host
for($start = 0; $start -le 100;$start++)
{
cls
$pro_percentage = Get-WmiObject win32_processor -computer $get -property Loadpercentage | select loadpercentage
$percentage = "Processor usage is: " + $pro_percentage.loadpercentage + "%"
$percentage
}
}
loop
There's a few other bits to the GUI that I've created but I've noticed one majour problem, and this goes for other GUI apps that I have created. Whenever the 'go' button is pressed to start the script from the dialog box, the GUI freezes. The menu bar that I've created inside the GUI freezes and no other button can be pressed.
Am I supposed to run each function in a different thread? Something like that?
Thanks
Try to add:
[System.Windows.Forms.Application]::DoEvents()
in your loop. Quick and dirty, however.

uimenucontroller in uiwebview with custom menu items without MORE menu

In my iPad app, there is a UIWebview that displays text content. When I tap hold and select a text, a menu should popup with 2 custom menu.
say, | MENU1 | MENU2 |
But it seems the COPY menu will also accompany, which I couldn't disable. Is there any possibilities to disable it? I tried around the forum and no solutions worked out.
so itz okay to keep the COPY menu along with the other 2. which should now look like
| Copy | MENU1 | MENU2 |
But unfortunately, I 'm getting it displayed with a MORE menu as follows :
| Copy | More... |
Clicking the More... menu is showing the other 2 menu.
But I need all those 2 items to be displayed in the first attempt itself. either just the 2 menus alone, or atleast along with the copy menu.
| Copy | MENU1 | MENU2 |
OR
| MENU1 | MENU2 |
Get me some solution please.... Trying it out in many ways.. But nothing is working out...
Plz help me out...
Thanks,
Brian
It doesn't appear that there is a way to do this without replacing the UIMenuController. One option is to handle your own UILongPressGestureRecognizer (see How to remove th COPY UIMenuItem in UIMenuController). I've seen proposals where you override canPerformAction, but this does not work. Interestingly, the "copy:" action is never called, though it seems that everything else (cut:,select:,etc.) is.
- (BOOL) canPerformAction:(SEL)action withSender:(id)sender
{
if (action == #selector(defineSelection:))
{
return YES;
}
else if (action == #selector(translateSelection:))
{
return YES;
}
else if (action == #selector(copy:))
{
return NO;
}
return [super canPerformAction:action withSender:sender];
}
`

Resources